un-stupidfied image width handling