Improved page size and page number validation.