Adding pagination to Gallery on the head page