Correctly implement the image upload