image upload bug fixes