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.