Saving patient's photo - refactoring