NXP-15051: extract generic stuff in nuxeo-dam, to be used in new nuxeo-dam MP