work with photo in model instead of controller