refactor PhotoController.upload