Added last page set to 1 if total displayed is less or equal to num to display