Added testing for centring images

And removed some dead code