check if user is logged in or not before uploading photos