Removed duplicate remove_nbsp function
Fixed Pagination issue when there are only 2 pages