One thing I can think of is to embed a KumaScript macro that adjusts the image paths. But, that seems possibly troublesome and one more thing to go wrong.

Could also insert a placeholder string like `%%ATTACHMENT_HOST%%` (or something equally ugly and distinctive, yet otherwise unused) and replace that at rendering time with the site's configured base URL. That could help make content portable between prod, stage, dev, and local VMs.