Refactored the photos template