Issue #4: Only show previous and next buttons when applicable.