Find an image tag? : <p>I have a content editable div, this could have any tags in it, eg.</p>

<pre><code>&lt;p&gt;hello&lt;/p&gt;
&lt;p&gt;whatever &lt;p&gt;nested p is a bad idea but can happen&lt;/p&gt;&lt;/p&gt;
&lt;div&gt;stuff&lt;/div&gt;
&lt;p&gt;test&lt;img&gt;&lt;/p&gt;
</code></pre>

<p>For a given element, I need to find the img tag that is above it in the source order. The image tag could be a direct sibling, or a child of a sibling or even a parent of the given element.</p>
