Photo pagination working for index page