Modified to not show first, last, next, prev when they don't need to appear