ImageCache imlemented

We've added an imageCache to our game and we use this to trigger when to
paint the pattern on the canvas.