Hides the final navigation links

Previously when the last page was reached that logic that hides the pagination links was not executed. With this update it ensures that pagination links are removed when the last page is reached.