BAMPFA-330: handle extraction of objectnumbers properly; generalize handling of media