Refactor CSS image size calculations
Move the calculation of the wrapper size to the wrapper element’s own
CSS, and inherit it in the img CSS as a variable. This shouldn’t have
any effect yet, but paves the way for tweaking the wrapper size in the
next commit.