Fix pagination for content types. Fixes #1725

 (and also simplified pagination a bit in the process. @rixbeck : are
there no unwanted side-effects, this way? )