added page pagination for gallery