But how about the reverse: a comment actually being an answer? Should it be flagged?
No. Just ask the commenter, like in the example you gave. I don't see why this would be clutter. If the commenter does not respond to this, too bad. You can either answer yourself (maybe make it a CW post), or ask the OP to do it.
And if so, are there tools for the moderators to convert those comments to answers?
No. Not currently, and I think it's good that there's no such thing.
And if so, should that be done? […] But when it dóes answer the question, why don't turn it into one?
No. I'll partly quote myself herepartly quote myself here: Comments are mostly written because the commenter did not want to write an answer in the first place. They have to have 50 reputation, therefore they know how the system works and they can post an actual answer if they want to.
Comments and answers are different concepts, and while you can easily turn a bad answer (or a non-answer) into a comment, if it's of bad quality or not particularly helpful, the other way 'round is – in my opinion – not a good idea.
Comments lack formatting like answers can have. Comments can't use more than 600 characters. Due to this size restriction, and maybe due to lazyness, comments also lack context and research.
If the commenter really wants to turn their comment into an actual answer, they should do so themselves, not by an automatic migration. In your specific example …
The im is just a namespace. You want 'image' element, not im
How is that an answer? It should at least make use of proper formatting, and even then it could explain a bit what is going on.