Hide pagination controls when the per-page value is 0

Fixes #907