Altered uploadImage with authentication.