hide prev and next buttons when not needed