Changed removePageRelatedTags function to ensure that only one match was being found per page number.