Older CUIDs include a 'ref' number, whereas newer ones include the archival object PK. In both cases, the page_id should just be the three or four-digit image sequence number.
Some archival objects also include a separate two or three-digit number indicating either a physical folder or an accession that was processed as separate collections. In this case, the page_id should include this number as well as the image sequence number.
Older CUIDs include a 'ref' number, whereas newer ones include the archival object PK. In both cases, the page_id should just be the three or four-digit image sequence number.
Some archival objects also include a separate two or three-digit number indicating either a physical folder or an accession that was processed as separate collections. In this case, the page_id should include this number as well as the image sequence number.