diff --git a/capsule-prototype/index.html b/capsule-prototype/index.html
index 5e206891d3939e3e7064330b274768553a1ac7df..40af2e8d598a101893be09c014a43629b4a41c6d 100644
--- a/capsule-prototype/index.html
+++ b/capsule-prototype/index.html
@@ -205,7 +205,7 @@
 	</div>
 
   <div id='edit_pic_modal' class='flex-col'>
-    <img id='annotation_img_edit' data-markerjs-state=''/>
+    <img id='annotation_img_edit' />
   </div>
 
   <div id='left_menu' class='flex-col editmode left_menu'>
diff --git a/capsule-prototype/js/online-rekall/Tag.js b/capsule-prototype/js/online-rekall/Tag.js
index e40d9f5162e6b1390093997b525476e8c6dcbff4..ba2cb345eb4c0c8f492c80998d427753f2ad59b2 100644
--- a/capsule-prototype/js/online-rekall/Tag.js
+++ b/capsule-prototype/js/online-rekall/Tag.js
@@ -98,6 +98,9 @@ Tag.prototype.openQuickLook = function() {
 Tag.prototype.downloadFile = function() {
 	return this.document.downloadFile();
 }
+Tag.prototype.getDownloadLink = function() {
+  return this.document.getDownloadLink();
+}
 Tag.prototype.openBrowser = function() {
 	return this.document.openBrowser();
 }   
diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js
index 9898d0bc1636f4092bd026a6a58d416731f3590d..628fc45697aabe89966c503bd92d62e0880e4a98 100644
--- a/capsule-prototype/js/online-script.js
+++ b/capsule-prototype/js/online-script.js
@@ -967,13 +967,14 @@ function fillPopupEdit(tag) {
 
   var type = tag.getMetadata("Rekall->Type");
 
+  $("#popupImg").unbind( "click" );
 	if(tag.isMarker()==true){
 		$("#popupImg").show();
 		$("#popupImg").attr("src","../shared/css/images/img-note.png");
 	} else {
 		if(tag.thumbnail.url){
 			$("#popupImg").attr("src",tag.thumbnail.url);
-      $('#annotation_img_edit').attr('src', tag.thumbnail.url);
+      $('#annotation_img_edit').attr('src', tag.getDownloadLink());
 		} else {
 			if(type.indexOf("image") > -1) $("#popupImg").attr("src","../shared/css/images/img-image.png")
 			else if(type.indexOf("pdf") > -1) $("#popupImg").attr("src","../shared/css/images/img-pdf.png")
@@ -994,7 +995,6 @@ function fillPopupEdit(tag) {
 				tag.openBrowser();
 		});
 	}
-  $("#popupImg").unbind( "click" );
 
 	$("#popupNom").css("color",tag.color);
 
@@ -1141,16 +1141,6 @@ function setProjectMeta(metaType, meta) {
 	});
 }
 
-function liteSetMetaFromDom(keyDoc, metaType, meta) {
-  var xhr = new XMLHttpRequest();
-  xhr.onload = ev => {
-    console.log('request done', ev);
-  };
-  xhr.open('POST', 'php/project.php');
-  xhr.setRequestHeader('Content-Type', 'application/json');
-  xhr.send(JSON.stringify({"key": keyDoc, "metadataKey": metaType, "metadataValue": meta}));
-}
-
 function setMetaFromDom(keyDoc, metaType, meta) {
 	rouletteStart();
 	$.ajax("php/project.php", {
diff --git a/capsule-prototype/js/rekall/Document.js b/capsule-prototype/js/rekall/Document.js
index ff38052ec1dda2e11e9b222710a48a539e84af4a..4ba477dbd6e81c292fee009f71494bd0671f7d31 100644
--- a/capsule-prototype/js/rekall/Document.js
+++ b/capsule-prototype/js/rekall/Document.js
@@ -86,6 +86,10 @@ Document.prototype.isLink = function(version) {
 	else
 		return type.startsWith("rekall/link"); 
 }
+Document.prototype.getDownloadLink = function() {
+       return Utils.getLocalFilePath(this, "file");
+}
+
 
 
 Document.availableMetadataKeys = new Object();
@@ -182,4 +186,4 @@ Document.prototype.downloadFile = function() {
 }
 
 function Metadata() {
-}
\ No newline at end of file
+}