Set max per page before current page.

Pagerfanta will have an incorrect number of page if we don't set max per page before current page.
Merge pull request #721 from kayue/patch-1

Set max per page before current page.