private static StdImage createOptimizedImage(Image image) {
		Toolkit tk = Toolkit.getDefaultToolkit();
		if (!tk.prepareImage(image, -1, -1, null)) {
			while (true) {
				int result = tk.checkImage(image, -1, -1, null);
				if ((result & (ImageObserver.ERROR | ImageObserver.ABORT)) != 0) {
					image = null;
					break;
				}
				if ((result & (ImageObserver.ALLBITS | ImageObserver.SOMEBITS | ImageObserver.FRAMEBITS)) != 0) {
					break;
				}
				// Try to allow the image loading thread a chance to run.
				// At least on Windows, not sleeping seems to be a problem.
				try {
					Thread.sleep(1);
				} catch (InterruptedException ie) {
					image = null;
					break;
				}
			}
		}
		if (image == null) {
			Log.error(new Exception(UNABLE_TO_LOAD_IMAGE));
			return create(1, 1);
		}
		StdImage buffer = createTransparent(image.getWidth(null), image.getHeight(null));
		Graphics2D gc = buffer.getGraphics();
		gc.drawImage(image, 0, 0, null);
		gc.dispose();
		return buffer;
	}