Improved the way that images were handled in theme