Check whether the user is logged in before making ajax calls to upload the photo to S3