Modify handling of image upload and prepare for merging