Fixed #2738 where legend navigation would add one page too many when the last page had two items.