Hide pagination when not necessary