private void centerComponents() {
      Rectangle bounds = getBounds();
      Point point = imageComponent.getLocation();
      // in embedded mode images should be left-side aligned
      point.x = isEmbedded ? 0 : (bounds.width - imageComponent.getWidth()) / 2;
      point.y = (bounds.height - imageComponent.getHeight()) / 2;
      imageComponent.setLocation(point);
    }
private void centerComponents()