Improved handling of page lengths in the T.85 decoder