(function($) {
  Alchemy.ImageCropper.destroy();
  Alchemy.closeCurrentDialog();
  Alchemy.setElementDirty('#element_<%= @content.element.id %>');
<% if @content.ingredient %>
  $('.thumbnail_background img', '#<%= @content.dom_id %>').replaceWith('<%= essence_picture_thumbnail(@content) %>');
  Alchemy.ImageLoader('#<%= @content.dom_id %> .thumbnail_background');
<% end %>
})(jQuery);

(function($) {
  Alchemy.closeCurrentDialog();
  Alchemy.setElementDirty('#element_<%= @content.element.id %>');
<% if @content.ingredient %>
  $('.thumbnail_background img', '#<%= @content.dom_id %>').replaceWith('<%= essence_picture_thumbnail(@content) %>');
  Alchemy.ImageLoader('#<%= @content.dom_id %> .thumbnail_background');
<% end %>
})(jQuery);

Remove old Image Cropper destroy from essence update
Remove old Image Cropper destroy from essence update

The image croppe rhas been refactoed into a ES6 class
and takes care of destroying itself on dialog close.
