add pagination to image gallery