minor changes to image upload code