Fix width and height detection for IE8.