Update to image upload function