I'm having trouble consistently getting the width of an element that is updated.

Here's a code snippet. I need to get the width of $newimg. You can see an attempt in line 5, var $imgwidth = $newimg.width() I've tried referring to it in a number of ways but the problem exists. If the image has already been loaded once it usually missess. I've tried a few when...then commands but got nowhere.

$('<img class="fp_preview" />').load(function(){
	var $newimg 		= $(this);
	var $currImage 	= $('#fp_gallery').children('img:first');
	var $imgwidth 	= $newimg.width();

	//expand clone
		'opacity'		: 0,
		'top'			: windowH/2 + 'px',
		'left'			: windowW/2 + 'px',
		'margin-top'	: '-200px',
		'margin-left'	: -final_w/2 + 'px',
		'width'			: final_w + 'px',
		'height'		: '400px'
	//now we have two large images on the page
	//fadeOut the old one so that the new one gets shown


	//show the navigation arrows