Code for uploading a photo