diff --git a/deploy.core.inc b/deploy.core.inc
index ef958f2..cd426a0 100644
--- a/deploy.core.inc
+++ b/deploy.core.inc
@@ -81,6 +81,91 @@ function field_deploy_entity_alter(&$entity, $entity_type) {
  * @} End of "Deployment alterations"
  */
 
+ /**
+ * Implements hook_entity_dependencies().
+ *
+ * For imce image deploy.
+ */
+function imce_entity_dependencies($entity, $entity_type) {
+  if (empty($entity) || empty($entity_type)) {
+    return;
+  }
+  
+  $file_dir = variable_get('file_public_path', conf_path() . '/files');
+  module_load_include('inc', 'imce', 'inc/imce.page');
+  
+  list(,, $bundle_name) = entity_extract_ids($entity_type, $entity);
+  $instances = field_info_instances($entity_type, $bundle_name);
+  $dependencies = array();
+  
+  foreach ($instances as $field_name => $instance) {
+    $field = field_info_field($field_name);
+    if ($field['module'] == 'text') {
+      foreach ($entity->{$field_name} as $langcode => &$items) {
+        foreach ($items as $item) {
+          $regex = '/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/im';
+          preg_match_all($regex, $item['value'], $matches);
+          if (!empty($matches[2])) {
+            foreach ($matches[2] as $path) {
+              if (!url_is_external($path)) {
+                $path =  urldecode(str_replace($file_dir, '', $path));
+                $uri=  rtrim($path, '/\\');
+                $file = deploy_imce_to_file_object(file_build_uri($uri));
+                if ($file && isset($file->fid)) {
+                 $dependencies[] = array('type' => 'file', 'id' => $file->fid);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  return $dependencies;
+}
+
+/**
+ * Returns a file object which can be passed to file_save().
+ * @param $uri
+ *  A string containing the URI, path, or filename.
+ * @param $use_existing
+ *  (Optional) If TRUE and there's an existing file in the {file_managed} table with the passed in URI, then that file object is returned.
+ *   Otherwise, a new file object is returned. Default is TRUE.
+ * @return object
+ *  A file object, or FALSE on error.
+ */
+
+function deploy_imce_to_file_object($uri, $use_existing = TRUE) {
+  $file = FALSE;
+  $uri = file_stream_wrapper_uri_normalize($uri);
+
+  if ($use_existing) {
+    // We should always attempt to re-use a file if possible.
+    $files = entity_load('file', FALSE, array('uri' => $uri));
+    $file = !empty($files) ? reset($files) : FALSE;
+  }
+  if (empty($file)) {
+    $file = new stdClass();
+    $file->uid = $GLOBALS['user']->uid;
+    $file->filename = basename($uri);
+    $file->uri = $uri;
+    $file->filemime = file_get_mimetype($uri);
+    // This is gagged because some uris will not support it.
+    $file->filesize = @filesize($uri);
+    $file->timestamp = REQUEST_TIME;
+    $file->status = FILE_STATUS_PERMANENT;
+    $errors = file_validate_is_image($file);
+    if (empty($errors)) {
+      file_save($file);
+      imce_file_register($file);
+    }
+    else {
+      return FALSE;
+    }
+  }
+  return $file;
+}
+
 /**
  * @defgroup deploy_operations Bulk operations
  * @{
