initial photo uploading code