add paging to sample viewer