diff --git a/lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js b/lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js
index <HASH>..<HASH> 100644
--- a/lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js
+++ b/lib/editor/tinymce/plugins/managefiles/tinymce/editor_plugin.js
@@ -93,9 +93,10 @@
 
             var managefiles = ed.getParam('managefiles', {});
             // Get draft area id from filepicker options.
-            if (!managefiles.itemid && M.editor_tinymce.filepicker_options 
-                    && M.editor_tinymce.filepicker_options[ed.id] 
-                    && M.editor_tinymce.filepicker_options[ed.id].image) {
+            if (!managefiles.itemid && M.editor_tinymce.filepicker_options
+                    && M.editor_tinymce.filepicker_options[ed.id]
+                    && M.editor_tinymce.filepicker_options[ed.id].image
+                    && M.editor_tinymce.filepicker_options[ed.id].image.itemid) {
                 managefiles.itemid = M.editor_tinymce.filepicker_options[ed.id].image.itemid;
                 ed.settings['managefiles'].itemid = managefiles.itemid;
             }
MDL-<I> Additional check to be extra sure that no JS error occurs