private void loadImages(@NotNull IdeaPluginDescriptor descriptor, @NotNull Object state) {
    if (!(descriptor instanceof PluginNode node) ||
        node.getExternalPluginIdForScreenShots() == null ||
        ApplicationManager.getApplication().isHeadlessEnvironment()) {
      handleImages(state, null);
      return;
    }

    List<String> screenShots = node.getScreenShots();
    if (ContainerUtil.isEmpty(screenShots)) {
      handleImages(state, null);
      return;
    }

    ProcessIOExecutorService.INSTANCE.execute(() -> {
      List<BufferedImage> images = new ArrayList<>();
      File parentDir = new File(PathManager.getPluginTempPath(), "imageCache/" + node.getExternalPluginIdForScreenShots());

      for (String screenShot : screenShots) {
        try {
          String name = Objects.requireNonNull(StringUtil.substringAfterLast(screenShot, "/"));
          if (!name.contains(".")) {
            name += ".png";
          }
          File imageFile = new File(parentDir, name);
          if (ApplicationManager.getApplication().isDisposed()) {
            return;
          }
          MarketplaceRequests.Companion.readOrUpdateFile(imageFile.toPath(), screenShot, null, "", stream -> {
            IOUtil.closeSafe(Logger.getInstance(PluginImagesComponent.class), stream);
            return new Object();
          });
          try (InputStream stream = new FileInputStream(imageFile)) {
            BufferedImage image = ImageIO.read(stream);
            if (image == null) {
              Logger.getInstance(PluginImagesComponent.class)
                .info("=== Plugin: " + node.getPluginId() + " screenshot: " + name + " not loaded ===");
            }
            else {
              images.add(image);
            }
          }
          catch (IOException e) {
            throw new IOException("Unable to read image file " + imageFile.getAbsolutePath(), e);
          }
        }
        catch (IOException e) {
          Logger.getInstance(PluginImagesComponent.class).error(e);
        }
      }

      ApplicationManager.getApplication().invokeLater(() -> handleImages(state, images), ModalityState.stateForComponent(this));
    });
  }
private void loadImages(@NotNull IdeaPluginDescriptor descriptor, @NotNull Object state)