Corrected support for adjacent

If we had 15 pages with 2 adjacent itens on page 5 it was showing [ 1 | 2 | 3 | 4 | .5. | 6 | ... | 14 | 15 ], the 5 page actualy didn't have the 2 adjacents at the end, and the same was happening to the end.