private void load(Image image, int[] widthDims, int[] heightDims) {
		imageWidth = (int)image.width();
		imageHeight = (int)image.height();
		
		float xOffset = 0, yOffset = 0;
		if (widthDims == null || heightDims == null) {
			imageWidth -= 2;
			imageHeight -= 2;
			
			int[] topPixels = new int[imageWidth];
			image.getRgb(1, 0, imageWidth, 1, topPixels, 0, imageWidth);
			
			int[] sidePixels = new int[imageHeight];
			image.getRgb(0, 1, 1, imageHeight, sidePixels, 0, 1);
			
			widthDims = getDims(topPixels);
			heightDims = getDims(sidePixels);
			
			// the .5 is for OpenGL issues with float-math sometimes leaving the black band visible
			xOffset = yOffset = 1.5f; 
		}
		
		this.widthDims = widthDims;
		this.heightDims = heightDims;
		
		imageLayers = new ImageLayerLike[heightDims.length][widthDims.length];
		touchDisabled = new boolean[heightDims.length][widthDims.length];
		int y = 0;
		for (int i = 0; i < heightDims.length; i++) {
			int x = 0;
			for (int j = 0; j < widthDims.length; j++) {
				if (widthDims[j] > 0 && heightDims[i] > 0) {
					Image subImage = image.subImage(x + xOffset, y + yOffset, widthDims[j], heightDims[i]);
					imageLayers[i][j] = factory.create(subImage);
					layer.add(imageLayers[i][j].layerAddable());
				}
				x += widthDims[j];
			}
			y += heightDims[i];
		}
		
		if (width == 0 || height == 0) {
			setSize(imageWidth, imageHeight);
		} else {
			onSizeChanged();
		}
	}