diff --git a/includes/uuid_file_entity.features.inc b/includes/uuid_file_entity.features.inc
index a26500d..27aed99 100644
--- a/includes/uuid_file_entity.features.inc
+++ b/includes/uuid_file_entity.features.inc
@@ -10,22 +10,47 @@
 function uuid_file_entity_features_export_options() {
   $options = array();
 
-  // Check what content types are enabled for uuid features export.
-  $enabled_types = variable_get('uuid_features_entity_file', FALSE);
-  if (!empty($enabled_types)) {
-    $query = new EntityFieldQuery();
-    $query
-      ->entityCondition('entity_type', 'file')
-      ->propertyCondition('type', $enabled_types, 'IN')
-      ->propertyOrderBy('filename')
-      ->propertyOrderBy('type');
-
-    $result = $query->execute();
-    if (!empty($result['file'])) {
-      $files = file_load_multiple(array_keys($result['file']));
-      foreach ($files as $file) {
-        $options[$file->uuid] = $file->filename;
+  $entity_info = entity_get_info();
+  $enabled_types = array();
+  foreach ($entity_info['file']['bundles'] as $key => $value) {
+    if (variable_get("uuid_features_file_file_{$key}", FALSE)) {
+      $enabled_types[$key] = $key;
+    }
+  }
+
+  if ($enabled_types) {
+    $field_map = field_info_field_map();
+    $enabled_fields = array();
+    foreach ($field_map as $name => $data) {
+      if (!isset($enabled_types[$data['type']])) {
+        continue;
       }
+      foreach ($data['bundles'] as $type => $bundles) {
+        if (!isset($entity_info[$type]['uuid features']) || !$entity_info[$type]['uuid features']) {
+          continue;
+        }
+        foreach ($bundles as $bundle) {
+          if (variable_get("uuid_features_file_{$type}_{$bundle}", FALSE)) {
+            $enabled_fields[$name][] = $bundle;
+          }
+        }
+      }
+    }
+
+    $query = db_select('file_managed', 'fm');
+    $or = db_or();
+    foreach ($enabled_fields as $field => $bundle) {
+      $query->leftJoin("field_data_{$field}", $field, "{$field}.{$field}_fid = fm.fid");
+      $or->condition("$field.bundle", $bundle);
+    }
+    $query->condition($or)
+     ->condition('fm.type', $enabled_types)
+     ->fields('fm', array('uuid', 'filename'))
+     ->orderBy('type')->orderBy('filename');
+
+    $files = $query->execute()->fetchAll();
+    foreach ($files as $file) {
+      $options[$file->uuid] = $file->filename;
     }
   }
 
