Fix the vertical alignment error for img tag.

It fixes the wrong vertical alignment for img element. (related to #2422, #2554)
Worked with @ryanc