Fixes to image upload