fix next_prev block bug that showed excluded pages in some cases

fix bug in next_prev block where last page in section gets returned even if it has the "exclude_nav" attribute.
Merge pull request #1042 from jordanlev/patch-22

fix next_prev block bug that showed excluded pages in some cases