Fix scroll down and up in double-page mode.

This commit fixes the bug described here: http://bugs.pwmt.org/issue414

When you are in double-page (or more), and push page-down, the current page increase by 2. For instance, you are at page 8, it goes to 10. However, if there are 9 pages and this page is alone on its row, it won't work.

This fixes it by simply considering that a negative number is page 0 and a number greater or equal to the number of page is the last page.