Should probably replace this with https://github.com/Islandora/islandora/blob/7.x/includes/ingest.form.inc#L839.