moved image upload to header to fix bug