add paging to the gallery