Shows pagination only if necessary and reduces the size of the pagination