Usually that is the result of how your DOM is build up.

Code: 
<a><img /></a>
<p>text</p>
That's what yours looks like and it's roughly the equivalent of this:
Code: 
<a><img /></a>
<br />
text
Notice the line break?
So:
Code: 
<p><a><img /></a>
text</p>
Along with the correct css should fix it. However I'm not sure if the P tag has restriction on what type of child elements it can have. If it has restrictions replacing P with DIV should solve it. God I the cross browser HTML mess.