[PD-801] Properly account for the number of items being shown per page when generating hrefs

Made the filter because arithmetic can't be done in templates (other than add). Not happy abou this, but it works.