Better pagination url generation; fixes pager prev/next states