refactor restangulars calls to photo model