First working version of image upload, untested.