Pagination

This PR addresses a pagination issue (RT#437982) where for a set of search results the second result page would always only show one result, the rest appearing on the following pages. This was a side effect of a previous try at fixing a different issue (RT#407475), which needed to be addressed elsewhere.