Copy over pkgdb pagination fixes...

..from fedora-infra/fedbadges#33
Merge pull request #6 from fedora-infra/feature/pkgdb-pagination

Copy over pkgdb pagination fixes...