I have experienced in numerous implementations that an image <img> wrapped by an <a> anchor or <span> tag shows some extended padding arbitrarily on top, bottom, or either side.
Is it browser specific, related to misuse of tags, or considered a flaw in html?
Images are (by default) rendered inline, and thus are treated as characters. Their default vertical-align setting is such that there is space below them for descenders (which you find on letters such as j, y and g, but not a, b or c) and there may be space above them depending on the current line height.
White space between the start tag of the span or anchor and the img tag, or between the img tag and the end tag of the span/anchor is significant (so the padding to the side is more likely to be a space)