function imgResize(image, maxWidth)
{
	//check if the width exceeds the max
    if(image.width > maxWidth)
    {
		//get the image ratio relative to the max width
    	var imgRatio = maxWidth / image.width;

		//get the new height based on the ratio
        image.height = image.height * imgRatio;
        image.width = maxWidth; //set the max width
    }
}
