Bug: Incorrectly handling reverse pagination

The pager wasn't taking into account how things differ when
repeating a query and merging the results when paging
in reverse as opposed to going forward.  Added a couple
conditionals to flip the logic around when going in reverse.

Fixes T76689

Bug: T76689
Change-Id: Iac30ba23c5c099a5c0165bd8bb9a50d771f52658
Merge "Bug: Incorrectly handling reverse pagination"