Issue #2782309 by samuel.mortenson, martin107: Refactor File and Image related image field creation logic into a new trait