Next.js Images with Tailwind Typography

Fix the aspect ratio of images in MDX

When using the Next.js Image component in MDX with Tailwind Typography your image might appear with an incorrect aspect ratio like this.

Stretched example

To fix it all you need to do is to add the object-contain class.