Use CKEditor to create and edit your templates. The CKEditor can handle images either by uploading or as base64 string: https://appstore.home.mendix.com/link/app/1715/Mendix/CKEditor-For-Mendix
See the documentation on Github: https://github.com/mendixlabs/CKEditorForMendix
Regards,
Ronald