[REF] refactor image export, so it's easier to inherit in custom module