def process_dupe_archive_entry(data, duplicates):
    """Take a dupe_archive_data entry and update photo_id if needed."""
    clean_photo_ids = []
    for photo_id in data.get('photo_ids'):
        if photo_id in duplicates:
            orig_photo_id = duplicates.get(photo_id).get('orig_photo_id')
            clean_photo_ids.append(orig_photo_id)
        else:
            clean_photo_ids.append(photo_id)
    data['photo_ids'] = clean_photo_ids
    return data