Second part of the photo uploading mechanism