Simplified by dropping support for having border and padding on the img element.