Adding pagination to gallery on head page