@irl I love MDX for that and more engines should use it (mine does, https://shayu.it)
media sucks either way though, yeah, kinda unsolved problem in Shayu right now too, other than an asset folder you just copy to prod..
@irl with how im using it I already made a smart Img component that fetches the src and codes the height/width in the html for proper placeholder ratios while things load, and it'd be quite doable to adapt with automatic thumbnailing as well