added first and last page pagination and a hard limit on page numbers shown