fix problem, if maxVisible is set to 0 or 1

This fixes a problem, if you want to show 0 pages, but only pref/next button
and
fixes a problem, if maxVisible is set to 1 and you click the 'next' button