Fix space formatting (minor change)

Add a missing space with code formatting.
Prevent negative image scaling

When the padding is greater than the component, the calculated scale is
negative (because the top of the image is above the bottom, or the left
is "on the right" of the right).

In that case, we want a 0-sized image, not a reversed image.