added code for uploading photos