Dimensions are converted to pixels for output in HTML-like formats. Use the --dpi option to specify the number of pixels per inch. The default is 96dpi.
Find the most common element in your pictures and use that. Only modify the exceptions.
Examples: dpi, width, height.
If you give it the dpi information:
Add the --dpi option as stated to override the default.
If most of your pictures have a common height or width, that should be easily corrected.
For example, you changed the line to:
![my caption](./figures/myimage.png){ width=250px }
or
![my caption](./figures/myimage.png){ height=256px }
Or do this in straight HTML markup:
<img src="./figures/myimage.png" alt="my caption" style="width: 250px;"/>
or
<img src="./figures/myimage.png" alt="my caption" style="height: 256px;"/>
and the ratio will be correct.
Reference: Pandoc Readme
For HTML and EPUB, all attributes except width and height (but including srcset and sizes) are passed through as is. The other writers ignore attributes that are not supported by their output format.
The width and height attributes on images are treated specially. When used without a unit, the unit is assumed to be pixels. However, any of the following unit identifiers can be used: px, cm, mm, in, inch and %.
Dimensions are converted to inches for output in page-based formats like LaTeX. Dimensions are converted to pixels for output in HTML-like formats. Use the --dpi option to specify the number of pixels per inch. The default is 96dpi.
The % unit is generally relative to some available space. For example the above example will render to
<img href="file.jpg" style="width: 50%;" />
(HTML),\includegraphics[width=0.5\textwidth] (LaTeX), or \externalfigure[file.jpg][width=0.5\textwidth]
(ConTeXt).Some output formats have a notion of a class (ConTeXt) or a unique identifier (LaTeX \caption), or both (HTML).
When no width or height attributes are specified, the fallback is to look at the image resolution and the dpi metadata embedded in the image file.