bug fix on uploading photos