8. Refactoring to save new pictures in database