Implemented AngularJS $resource object to fetch photos