Put images in container divs in random groups of 1, 2 or 3 elements each
<p>i have a series of images
let's say</p>

<pre><code>&lt;img src="1.jpg" /&gt;
&lt;img src="2.jpg" /&gt;
&lt;img src="3.jpg" /&gt;
&lt;img src="4.jpg" /&gt;
&lt;img src="5.jpg" /&gt;
&lt;img src="6.jpg" /&gt;
</code></pre>

<p>so on and so forth.</p>

<p>and what i need to happen is to wrap in random 1,2 or 3 elements inside a div.
so result would be</p>

<pre><code>&lt;div&gt;
 &lt;img src="1.jpg" &gt;
&lt;/div&gt;
&lt;div&gt;
 &lt;img src="2.jpg" &gt;&lt;img src="3.jpg"&gt;&lt;img src="4.jpg"&gt;
&lt;/div&gt;
&lt;div&gt;
 &lt;img src="5.jpg" &gt;&lt;img src="6.jpg" &gt;
&lt;/div&gt;
</code></pre>

<p>any ideas how to do this?</p>

<p>Thank you!</p>

<p>------ EDIT -------
How to do the same thing but this time the images are wrapped within an ? simply replacing img in Bojan's doesn't seem to do the trick..</p>
