Refactoring to save new pictures in database part 2