fix pagination back and foreward button on first or last page

On the first and last page the pagination gave a broken link