added savePhoto() logic to UploadPhoto and added unit test