Fixes #3410 the image shift

Changing image centering from JavaScript to CSS let the layout engine do the hard work.

also trailing spaces removed from clearing.js