Plain old markdown image syntax also works, although there is no way to preprocess the file or add any additional HTML attributes beyond what you see here:
 I think you could do this with a render hook if you want to get fancy (with the benefit that the Markdown for your posts stays as plain Markdown): https://werat.dev/blog/automatic-image-size-attributes-in-hu...