Fix image upload and edit