I\'m using Jekyll and all my posts are in .md format for convenience.
The problem is that the generator is automatically wrapping every line in paragraph tags.
Images are inline elements, intended to reside within a block-level element like a paragraph. Markdown parsers are therefore correcting your ‘mistake’ and wrapping the img inside a paragraph tag.
Wrapping your img tag inside an appropriate block-level element, like figure should prevent this behaviour. Eg:
If you want to automate things a little and you are not planning to generate your site on Github pages (where plugins are not allowed) then you can make use of a plugin to assist in this and make image insertion in your posts easier. I'm using a modified version of this plugin: