This is not quite a valid PDF file scenario according to PDF file specification. However, we may try handling it in order to show the correct number of pages. When the kid is of type Pages, it should be added to the pages traversal recursion only the first time it is met. The observed issue is demonstrated in the attached image.