JQuery Dialog

Hey there,

I have a dialog which will contain various different size pictures. For this reason I had to set the width to auto instead of giving it a fixed width but in doing so, my dialog is no longer centered. Can anyone help? Here is my code:


		$(".ui-icon-zoomin").live('click', function(event) {
				 event.preventDefault();
				 $item = $(this).parent();
				 $item.find( "img" ).animate({ width: "400px", height: "340px"});  
				$item.find( ".ui-icon-trash" ).hide();
				$item.find( ".ui-icon-zoomin" ).hide();
				//$item.append( close_icon );
				$("#gallery, #trash").sortable({disabled: true });
				$item.dialog({modal:true, width:"auto"});
		

				
		});