Seems like your markup is like this:
<div><a><img></a></div>
In that case img will not align with the bottom of the div; it aligns with the baseline; below the baseline is a 2-3 pixels gap which you are referring to (actual number depends on font, font size and line height). This is explained with screenshots here:
How to Remove the Space Below Images and Other Inline-Block Elements
The correct solution is to add the following css rule to the img tag:
#selector img {
vertical-align: bottom;
}
Your current trick should also work but it will have side effects (e.g. a stretches all the way across the header). Changing the img to block would be better.