I think this can be done by change regex parsing the width and length of the image in markdown or external plugin.
For example default markdown syntax for images , we can change it to  and set value in style of image like style="width:200px; height:400px"