Script for adding an image at the very end of the last paragraph for multiple blocks
<p>For each article on a page, I would like to insert an image at the very end of the last paragraph. My HTML looks like this: </p>

<pre><code>&lt;div class="storycontent"&gt;
   &lt;p&gt;One&lt;/p&gt;
   &lt;p&gt;Two&lt;/p&gt;
   &lt;p&gt;Three&lt;/p&gt;
&lt;/div&gt; 
</code></pre>

<p>There may be several of those sections or only one. There is also an unknown number of <code>&lt;p&gt;&lt;/p&gt;</code> tags. </p>

<p>What I would like to do is insert an <code>&lt;img /&gt;</code> at the very end of the last <code>&lt;p&gt;</code> before the closing tag.</p>

<p>Here is what I have so far, but it is only appending the image tag to the very last <code>&lt;p&gt;</code> on the page, and not the last one in the <code>storycontent</code> <code>&lt;div&gt;</code></p>

<pre><code>jQuery('.storycontent').each(
    function(){
        jQuery(this).last('p').append(img); 
                    //img is a var which contains an Image() element;
    }
);
</code></pre>
