First part of the photo uploading mechanism