private Image getImage(AffineTransform transformation)
  {
      if (cachedImage == null || lastZoom != pModel.getZoom() || lastOffsetX != pModel.getViewOffsetX() || lastOffsetY != pModel.getViewOffsetY()
              || lastCanvasWidth != pModel.getCanvasWidth() || lastCanvasHeight != pModel.getCanvasHeight())
      {
          cachedImage = createNewImage(transformation);
          lastZoom = pModel.getZoom();
          lastOffsetX = pModel.getViewOffsetX();
          lastOffsetY = pModel.getViewOffsetY();
          lastCanvasWidth = pModel.getCanvasWidth();
          lastCanvasHeight = pModel.getCanvasHeight();
      }
      
      return cachedImage;
  }