Handy snippet from Andras Sztrokay to handle inline images when using Gmail draft messages as part of your script projects. As highlighted by Romain Vialard in the Google Apps Script community:
Google added the ability to easily retrieve the inline images in an existing draft via the
getAttachments()method on October 30, 2018 (see Apps Script release notes)
Source: Inline images break when embedded from the htmlBody of an existing draft [GmailApp] [Apps Script]
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.