 
   displayCachedImage: (file)->
     @node = current_editor.getNode()
-    replaced_node = $(@node).replaceWith(@insertTemplate())
+    #copy previous name before swap nodes
+    new_node = $(@insertTemplate()).attr("name", $(this.node).attr("name") )
+    replaced_node = $(@node).replaceWith( new_node )
 
     current_editor.tooltip_view.hide()
     reader = new FileReader()

    $(@el).show()

  toggleOptions: ()=>
    utils.log "OLI!!"
    $(@el).toggleClass("is-active is-scaled")

  move: (coords)->


  insertTemplate: ()->
    "<figure contenteditable='false' class='graf graf--figure is-defaultValue' name='' tabindex='0'>
      <div style='' class='aspectRatioPlaceholder is-locked'>
        <div style='padding-bottom: 62.5%;' class='aspect-ratio-fill'></div>
        <img src='' data-height='375' data-width='600' data-image-id='' class='graf-image' data-delayed-src=''>
      </div>
