Bug: names manually specified for embedded images are overridden and have extension added, breaking cid: references in HTML body

Greetings,
Could you please let me know how to use withEmbeddedImages feature while sending emails ?
I tried to use both withAttachments and withEmbeddedImages in the same manner.
Only withAttachments work fine. withEmbeddedImages fail to display the images inline in the email.

Please Support.