wrapAll two siblings - How?

wrapAll two siblings - How?

Hello,

I want to wrap two html elements with a <div>.

I want only the <img> that has a next sibling '<div class="last">'
and
'<div class="last">' that has the previous sibling <img>


First I tried with no avail
Code:  [Select]
$('.main img ~ div.last').wrapAll('<div></div>');

I've tried adding 
Code:  [Select]
$('.main img ~ div.last').prev().next().wrapAll('<div></div>');
But that just wraps the next sibling, not including the previous.

Could someone point me in the right direction?