function loadImage(path, resolve) {
  const img = new Image();
  img.addEventListener("load", () => {
    resolve(img);
  });
  img.addEventListener("error", () => {
    throw new Error("Failed to load image ressource " + path);
  });
  img.src = path;
}
@param {String} path
@param {Function} resolve