e.rows({ selected: true }).count();
        imagesDataTable.button(0).enable(selectedRows === 1);
        imagesDataTable.button(2).enable(selectedRows > 0);
        imagesDataTable.button(4).enable(selectedRows > 0);
      });
    }

    function deleteImages(){
      var deleteImagesHiddenInput = JSON.parse($("#deleteImagesHiddenInput").val());
      console.log("Info: deleting images " + deleteImagesHiddenInput.join(", "));
      for (let i = 0; i < deleteImagesHiddenInput.length; i++) {
        $.post("