$j(function()
{
	$j('.mod-images').each(function()
	{
		var that = $j(this);
		
		var maxWidth = that.parent().width();
		
		var handleImage = function()
		{
			var that = $j(this);
			
			if (that.width() > maxWidth)
			{
				that.width(maxWidth);
			}
		};
		
		that.find('img').each(function()
		{
			if (this.complete)
			{
				handleImage();
			}
			else
			{
				this.onload = this.onerror = this.onabort = handleImage;
			}
		});
	});
});