switchImages(selected) {
    const selection_changed =
      (selected && !this.selected) || (!selected && this.selected);
    this.selected = selected; // Remember new selection

    if (this.imageObjAlt !== undefined && selection_changed) {
      const imageTmp = this.imageObj;
      this.imageObj = this.imageObjAlt;
      this.imageObjAlt = imageTmp;
    }
  }
Set selection and switch between the base and the selected image.

Do the switch only if imageObjAlt exists.
@param {boolean} selected value of new selected state for current node