template getPhotos method throws exception if error