Fix image upload bug