diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/export.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/export.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bcfffd85c84d4d6b064ed2e4c2678b7ddcee983a
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/export.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_exchange</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>export</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>1.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Export</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/ImageDocument_viewTargetFileDialog</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/fullsize_view.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/fullsize_view.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c663cb8c62f25854068a95d4ba0653d8a514ed6d
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/fullsize_view.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>fullsize_view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>30.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Full Sized Image</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Image_viewFullSizedImage</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/history.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/history.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8dc76631f38401ae637f2080a84135d05715ab88
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/history.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>history</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>60.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>History</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Base_viewHistory</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/local_permission.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/local_permission.xml
new file mode 100644
index 0000000000000000000000000000000000000000..95c4057eb844318be0fd5e8689eb3d3be400f965
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/local_permission.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>local_permission</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>50.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Local Roles</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Base_viewLocalPermission</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/metadata.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/metadata.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cc120f76b302fa919f7aa2cea3e67944411748c9
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/metadata.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>metadata</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>Manage properties</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>70.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Metadata</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Base_viewMetadata</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/print.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/print.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ac173a595d9957d1e2b769761c8c9ac2b5144515
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/print.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_print</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>print</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>20.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Print</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/ImageDocument_print</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/related_document.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/related_document.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a1b65d55c6ba5dc49cd271e0efc46988a44af5e6
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/related_document.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>related_document</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>40.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Related Documents</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Document_viewRelated</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/view.xml b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/view.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1c7294373fdfb3d656cf852908ea4867fa0f8a9f
--- /dev/null
+++ b/bt5/erp5_dms/ActionTemplateItem/portal_types/ImageDocument/view.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.ActionInformation</string>
+          <string>ActionInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>10.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>View</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.CMFCore.Expression</string>
+          <string>Expression</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/DMSFile_view</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/ModuleTemplateItem/document_module.xml b/bt5/erp5_dms/ModuleTemplateItem/document_module.xml
index 8b55eaf43e4c336696e8f3ca09eef10b88a5214f..96eaca047e8233820fd9c2c57e2bcb2640312dbb 100644
--- a/bt5/erp5_dms/ModuleTemplateItem/document_module.xml
+++ b/bt5/erp5_dms/ModuleTemplateItem/document_module.xml
@@ -352,6 +352,9 @@
   <permission type='list'>
    <name>Edit ReStructuredText</name>
   </permission>
+  <permission type='list'>
+   <name>Edit target</name>
+  </permission>
   <permission type='list'>
    <name>FTP access</name>
   </permission>
diff --git a/bt5/erp5_dms/ModuleTemplateItem/image_module.xml b/bt5/erp5_dms/ModuleTemplateItem/image_module.xml
index c4ebbe42f45fd7863734b7c1ab2c6b35aabd87d2..f47b5896658fe090597889bde9fb7a4cd8b0e8d7 100644
--- a/bt5/erp5_dms/ModuleTemplateItem/image_module.xml
+++ b/bt5/erp5_dms/ModuleTemplateItem/image_module.xml
@@ -352,6 +352,9 @@
   <permission type='list'>
    <name>Edit ReStructuredText</name>
   </permission>
+  <permission type='list'>
+   <name>Edit target</name>
+  </permission>
   <permission type='list'>
    <name>FTP access</name>
   </permission>
diff --git a/bt5/erp5_dms/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_dms/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
index b3d7eb708f01c4a50cd26fe21bc5c942291e5548..b701e1ee4871454a8ffa77bbb4243464f1e835c4 100644
--- a/bt5/erp5_dms/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
+++ b/bt5/erp5_dms/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
@@ -19,6 +19,9 @@
  <portal_type id="Image Module">
   <item>Image</item>
  </portal_type>
+ <portal_type id="ImageDocument">
+  <item>Role Definition</item>
+ </portal_type>
  <portal_type id="PdfDocument">
   <item>Role Definition</item>
  </portal_type>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/DMS%20File.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/DMS%20File.xml
index 4c2bcdd0fbcdceaf27e093b1e0ac0921d9d40795..c111757e4fdb6077aeb0b33f464b15fd66009156 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/DMS%20File.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/DMS%20File.xml
@@ -79,7 +79,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Graphic.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Graphic.xml
index 6eb632169edb4fd2c7d5971f193eab4216e2f91a..14712a747fe5ad8cc45122f46098067d95634e19 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Graphic.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Graphic.xml
@@ -81,7 +81,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/ImageDocument.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/ImageDocument.xml
new file mode 100644
index 0000000000000000000000000000000000000000..84d6820b4157572870e9e276c186020c5b4f40ce
--- /dev/null
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/ImageDocument.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.ERP5Type</string>
+          <string>ERP5TypeInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_actions</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_aliases</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_roles</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>acquire_local_roles</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>allowed_content_types</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>base_category_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_icon</string> </key>
+            <value> <string>document.gif</string> </value>
+        </item>
+        <item>
+            <key> <string>content_meta_type</string> </key>
+            <value> <string>ERP5 Image Document</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>  </string> </value>
+        </item>
+        <item>
+            <key> <string>factory</string> </key>
+            <value> <string>addImageDocument</string> </value>
+        </item>
+        <item>
+            <key> <string>filter_content_types</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>group_list</string> </key>
+            <value>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>hidden_content_type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ImageDocument</string> </value>
+        </item>
+        <item>
+            <key> <string>init_script</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>property_sheet_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/PdfDocument.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/PdfDocument.xml
index 6c0b870e312cb6435235f6f5ee72ca3ec3487b28..aaab61f85b12784fee1efa5e5dc3c7f99aa0c4d8 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/PdfDocument.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/PdfDocument.xml
@@ -76,7 +76,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Presentation.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Presentation.xml
index cbe0fa16dc019648c752823401dcee5647ab7803..be0c0ffdd067782fce99301b6d1299f70035b01f 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Presentation.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Presentation.xml
@@ -87,7 +87,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Spreadsheet.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Spreadsheet.xml
index c542d627be3562abe2d59319ad4241b169898151..460015f94746ab23c5d498db63d85381dd52beb9 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Spreadsheet.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Spreadsheet.xml
@@ -81,7 +81,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Text.xml b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Text.xml
index e854cdedd001375b2331d79caed2ee9578dd8b36..da2e918bd37ec5751ea19d80f582768869365d58 100644
--- a/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Text.xml
+++ b/bt5/erp5_dms/PortalTypeTemplateItem/portal_types/Text.xml
@@ -81,7 +81,9 @@
         <item>
             <key> <string>group_list</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>dms_document</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/bt5/erp5_dms/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
index 35780989bf7513a3c38446d578e4a238f1ce3fa5..bb4b392831b53996a659fbba22e7694d1aed7859 100644
--- a/bt5/erp5_dms/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+++ b/bt5/erp5_dms/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
@@ -7,6 +7,10 @@
   <type>Graphic</type>
   <workflow>ooo_interaction_workflow, edit_workflow, local_permission_interaction_workflow, dms_file_interaction_workflow, document_publication_workflow</workflow>
  </chain>
+ <chain>
+  <type>ImageDocument</type>
+  <workflow>dms_file_interaction_workflow, local_permission_interaction_workflow, document_publication_workflow, edit_workflow</workflow>
+ </chain>
  <chain>
   <type>PdfDocument</type>
   <workflow>dms_file_interaction_workflow, edit_workflow, document_publication_workflow, local_permission_interaction_workflow</workflow>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view.xml
index 97623caebb41c372b229845ae10b8fdd8161fec4..8f397707b29bdbaa55d76a5b0ba0feb30d72c9af 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view.xml
@@ -118,6 +118,7 @@
                       <list>
                         <string>my_source_project_title</string>
                         <string>my_dms_category_list</string>
+                        <string>image_view</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/image_view.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/image_view.xml
new file mode 100644
index 0000000000000000000000000000000000000000..047b28cad928892e4432aeb634e374eeb9acbc23
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/image_view.xml
@@ -0,0 +1,344 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Form.ImageField</string>
+          <string>ImageField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>image_view</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_display</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_format</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_resolution</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_display</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_format</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>image_resolution</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>image_display</string> </key>
+                    <value> <string>thumbnail</string> </value>
+                </item>
+                <item>
+                    <key> <string>image_format</string> </key>
+                    <value> <string>jpg</string> </value>
+                </item>
+                <item>
+                    <key> <string>image_resolution</string> </key>
+                    <value> <int>75</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Thumbnail</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>here/absolute_url</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: here.getPortalType()==\'ImageDocument\'</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/my_source_reference.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/my_source_reference.xml
index 23ab6746013c8a9d5109df7da5f46dd3f73c252b..61c0943b08bcf3676b8a0f79cc62e888a969c5f0 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/my_source_reference.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSFile_view/my_source_reference.xml
@@ -279,7 +279,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>here/getOriginalFilename</string> </value>
+            <value> <string>here/getSourceReference</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findDocument.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findDocument.xml
index 27465cb4a6dbb2d90e8d8f99e252b164f67e0cae..a0844fcbed08528013ada628630400be96035e5f 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findDocument.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findDocument.xml
@@ -68,9 +68,21 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string># dummy simple implementation\n
+            <value> <string># dummy simple implementation - return the newest in the chosen language\n
+# or in any language if not specified\n
+\n
+# ref arg is a tuple\n
+# ref[0] is a complete reference string\n
+# ref[1] is a dict of values from parsed reference string\n
+\n
 reference=ref[1][\'reference\']\n
-return context.portal_catalog(reference=reference)\n
+res=context.portal_catalog(reference=reference)\n
+res=[r.getObject() for r in res]\n
+lng=ref[1].get(\'language\')\n
+if lng is not None:\n
+  res=filter(lambda o:o.getLanguage()==lng,res)\n
+res.sort(key=lambda o:o.getVersion(),reverse=True)\n
+return res\n
 </string> </value>
         </item>
         <item>
@@ -117,7 +129,16 @@ return context.portal_catalog(reference=reference)\n
                             <string>_getitem_</string>
                             <string>reference</string>
                             <string>_getattr_</string>
-<string>context</string>
+                            <string>context</string>
+                            <string>res</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>r</string>
+                            <string>lng</string>
+                            <string>None</string>
+                            <string>filter</string>
+                            <string>True</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findPredecessors.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findPredecessors.xml
index fdf2f7965e46f598ed485875101f18117271c7b3..cfb0056338494636e76d7237ad0a1f653889de86 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findPredecessors.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_findPredecessors.xml
@@ -68,11 +68,17 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>txt1=context.getReference()\n
-txt2=context.getReference()+\'-\'+context.getLanguage()\n
-txt3=context.getReference()+\'-\'+context.getLanguage()+\'-\'+context.getVersion()\n
+            <value> <string># we search for docs that reference us in any way (reference only or more specific)\n
+# we can return raw set, the class will get objects and make the records unique\n
+# if you want only the most recent versions, filter the result and apply DMS_findDocument \n
+ss=[]\n
+ss.append(context.getReference())\n
+if context.getLanguage() is not None:\n
+  ss.append(context.getReference()+\'-\'+context.getLanguage())\n
+  if context.getVersion() is not None:\n
+    ss.append(context.getReference()+\'-\'+context.getLanguage()+\'-\'+context.getVersion())\n
 lst=[]\n
-for t in (txt1,txt2,txt3):\n
+for t in ss:\n
   lst+=context.portal_catalog(SearchableText=\'%\'+t+\'%\')\n
 return lst\n
 </string> </value>
@@ -119,11 +125,10 @@ return lst\n
                           <tuple>
                             <string>a</string>
                             <string>kw</string>
+                            <string>ss</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>txt1</string>
-                            <string>txt2</string>
-                            <string>txt3</string>
+                            <string>None</string>
                             <string>lst</string>
                             <string>_getiter_</string>
                             <string>t</string>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_getTargetFile.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_getTargetFile.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a7a348e55a2c032e21b88ab50e02211e0538aa2f
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_getTargetFile.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>request=context.REQUEST\n
+fname=request.get(\'filename\')\n
+format=request.get(\'format\')\n
+context.log(\'format\',format)\n
+if fname is None or format is None:\n
+  return\n
+if not fname.endswith(\'.\'+format):\n
+  fname+=\'.\'+format\n
+request.RESPONSE.setHeader(\'Content-type\', \'application/\'+format)\n
+request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % fname)\n
+return context.index_html(request,request.RESPONSE,display=\'medium\',format=format)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>**kw</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>kw</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>request</string>
+                            <string>fname</string>
+                            <string>format</string>
+                            <string>None</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ImageDocument_getTargetFile</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog.xml
new file mode 100644
index 0000000000000000000000000000000000000000..80860acee2fb8c1a25022b39712446be10213069
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Form.Form</string>
+          <string>ERP5Form</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value> <string>ImageDocument_getTargetFile</string> </value>
+        </item>
+        <item>
+            <key> <string>encoding</string> </key>
+            <value> <string>UTF-8</string> </value>
+        </item>
+        <item>
+            <key> <string>enctype</string> </key>
+            <value> <string>multipart/form-data</string> </value>
+        </item>
+        <item>
+            <key> <string>group_list</string> </key>
+            <value>
+              <list>
+                <string>left</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>groups</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>left</string> </key>
+                    <value>
+                      <list>
+                        <string>my_format</string>
+                        <string>my_filename</string>
+                      </list>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ImageDocument_viewTargetFileDialog</string> </value>
+        </item>
+        <item>
+            <key> <string>method</string> </key>
+            <value> <string>POST</string> </value>
+        </item>
+        <item>
+            <key> <string>name</string> </key>
+            <value> <string>ImageDocument_viewTargetFileDialog</string> </value>
+        </item>
+        <item>
+            <key> <string>pt</string> </key>
+            <value> <string>form_dialog</string> </value>
+        </item>
+        <item>
+            <key> <string>row_length</string> </key>
+            <value> <int>4</int> </value>
+        </item>
+        <item>
+            <key> <string>stored_encoding</string> </key>
+            <value> <string>UTF-8</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Download Target File</string> </value>
+        </item>
+        <item>
+            <key> <string>unicode_mode</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>update_action</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_filename.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_filename.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f07f4be604b31966c1bfa1fb87f9eafa47d9ee06
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_filename.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_filename</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>40</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Target Filename</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python:\'%s-%s-%s\' % (here.getReference(), here.Language(), here.getVersion())</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_format.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_format.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a4793f879faa4aec8095180ce516e31a7f7e43f3
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ImageDocument_viewTargetFileDialog/my_format.xml
@@ -0,0 +1,285 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>ListField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_format</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>unknown_selection</string> </key>
+                    <value> <string>You selected an item that was not in the list.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra_item</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>first_item</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list>
+                        <tuple>
+                          <string>JPEG</string>
+                          <string>jpg</string>
+                        </tuple>
+                        <tuple>
+                          <string>Bitmap</string>
+                          <string>bmp</string>
+                        </tuple>
+                        <tuple>
+                          <string>GIF</string>
+                          <string>gif</string>
+                        </tuple>
+                        <tuple>
+                          <string>PNG</string>
+                          <string>png</string>
+                        </tuple>
+                      </list>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>size</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Target Format</string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml
index 4b6521cd5bd7008fd365f5acccf41c051908c313..338f081ea4a9f6cd03cd4a48bc7e31f1cd71ffbf 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml
@@ -41,6 +41,7 @@
             <value>
               <list>
                 <string>AssignCategories</string>
+                <string>ClearCacheUponUpload</string>
                 <string>SetReferenceFromFilename</string>
               </list>
             </value>
@@ -73,6 +74,7 @@
               <list>
                 <string>DMS File</string>
                 <string>Graphic</string>
+                <string>ImageDocument</string>
                 <string>PdfDocument</string>
                 <string>Presentation</string>
                 <string>Spreadsheet</string>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/ClearCacheUponUpload.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/ClearCacheUponUpload.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a4ccf62d59c94e69136043e499a45f14e795e83a
--- /dev/null
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/ClearCacheUponUpload.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>ob=state_change.object\n
+kw=ob.REQUEST\n
+ob.log(\'interaction\',\'edit\')\n
+f=kw.get(\'my_file\',None)\n
+ob.log(\'f\',f)\n
+\n
+if f is not None and f:\n
+  # if file uploaded, then:\n
+  ob.clearCache()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>state_change</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>state_change</string>
+                            <string>_getattr_</string>
+                            <string>ob</string>
+                            <string>kw</string>
+                            <string>None</string>
+                            <string>f</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ClearCacheUponUpload</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/File_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/File_edit.xml
index 2dff8b74678ce87735e9162c2edfec4e98b0eaca..11d2e5ad464430e73c80379dcf4ecbe50071df19 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/File_edit.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/File_edit.xml
@@ -83,9 +83,6 @@ if f is not None and f:\n
   context.log(context.getPortalType(),ctype)\n
   if ctype is not None:\n
     raise Exception(\'This file should be created as \'+ctype)\n
-  ob.setSourceReference(fname)\n
-  if not ob.getTitle():\n
-    ob.setTitle(fname)\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml
index 268be6accea5dacb8a3266349bce59a26ea029e6..fa6711c5833d749b620ad12968dc36f333e2b553 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml
@@ -85,9 +85,6 @@ if f is not None and f:\n
     raise Exception(\'This file should be created as DMS File\')\n
   if ctype!=ob.getPortalType():\n
     raise Exception(\'This file should be created as \'+ctype)\n
-  ob.setSourceReference(fname)\n
-  if not ob.getTitle():\n
-    ob.setTitle(fname)\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/SetReferenceFromFilename.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/SetReferenceFromFilename.xml
index 82867c469e232392eace100f8a647ce6d23f99d3..c0151a9e901758c181f1f6c7f64abb3861c365c2 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/SetReferenceFromFilename.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/SetReferenceFromFilename.xml
@@ -70,15 +70,16 @@
             <key> <string>_body</string> </key>
             <value> <string>ob=state_change.object\n
 kw=ob.REQUEST\n
-ob.log(\'interaction\',\'edit\')\n
 f=kw.get(\'my_file\',None)\n
-ob.log(\'f\',f)\n
+ob.log(script.getId(),ob.getRelativeUrl())\n
 \n
 if f is not None and f:\n
   # if file uploaded, then:\n
-  ob.log(\'file\',f)\n
   fname=f.filename\n
   ob.setPropertiesFromFilename(fname)\n
+  ob.setSourceReference(fname)\n
+  if not ob.getTitle():\n
+    ob.setTitle(fname)\n
 </string> </value>
         </item>
         <item>
@@ -127,6 +128,7 @@ if f is not None and f:\n
                             <string>kw</string>
                             <string>None</string>
                             <string>f</string>
+                            <string>script</string>
                             <string>fname</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml
index 846359386726742a60ca0297b3a8af532cfc6945..60a7123e6d70ae7ef656ec36a63d163c391f31cc 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml
@@ -103,7 +103,6 @@ if f is not None and f:\n
   ob.setSourceReference(fname)\n
   ob.setTitle(fname)\n
   ob.setLastUploadTime(DateTime())\n
-  ob.clearCache()\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_dms/bt/change_log b/bt5/erp5_dms/bt/change_log
index 611e045a5850f87207a1fdc4a0b7701f16468aa6..8aad120deb5d398c477b719e7b34cea5b0dd78c4 100644
--- a/bt5/erp5_dms/bt/change_log
+++ b/bt5/erp5_dms/bt/change_log
@@ -1,3 +1,6 @@
+2006-08-30 BG
+Added ImageDocument type; assigned types to group dms_document.
+
 2006-08-26 BG
 Changed way to store original filename;
 Implemented listing wiki predecessors and successors
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 6d58c4e590bdd76fbff00cfc9505eedd3cc90f32..c9c41087e2102d5af5f3ea8aa420e47ad3085707 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-109
\ No newline at end of file
+114
\ No newline at end of file
diff --git a/bt5/erp5_dms/bt/template_action_path_list b/bt5/erp5_dms/bt/template_action_path_list
index 32cddcc153a7454b1b7ff02d8efeca81a3eb78fd..a3660ebe6245d62f017eaa51f6ff8b6155149389 100644
--- a/bt5/erp5_dms/bt/template_action_path_list
+++ b/bt5/erp5_dms/bt/template_action_path_list
@@ -24,6 +24,14 @@ Graphic | view
 Image Module | list_ui
 Image Module | sort_on
 Image Module | view
+ImageDocument | export
+ImageDocument | fullsize_view
+ImageDocument | history
+ImageDocument | local_permission
+ImageDocument | metadata
+ImageDocument | print
+ImageDocument | related_document
+ImageDocument | view
 PdfDocument | download
 PdfDocument | history
 PdfDocument | html_view
diff --git a/bt5/erp5_dms/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_dms/bt/template_portal_type_allowed_content_type_list
index cf9ea082b1b3e48a5c377dbf2e3fb26f2544cdbb..b440112f2207079627a866c6b9a18d75dc3eec29 100644
--- a/bt5/erp5_dms/bt/template_portal_type_allowed_content_type_list
+++ b/bt5/erp5_dms/bt/template_portal_type_allowed_content_type_list
@@ -8,6 +8,7 @@ Document Module | Text
 File | Role Definition
 Graphic | Role Definition
 Image Module | Image
+ImageDocument | Role Definition
 PdfDocument | Role Definition
 Presentation | Role Definition
 Spreadsheet | Role Definition
diff --git a/bt5/erp5_dms/bt/template_portal_type_id_list b/bt5/erp5_dms/bt/template_portal_type_id_list
index 4c1754acbf019ac4b8a5883ea143b209fc45f996..7ef2b2fc373ac86c50a6048023fd9884a037b8db 100644
--- a/bt5/erp5_dms/bt/template_portal_type_id_list
+++ b/bt5/erp5_dms/bt/template_portal_type_id_list
@@ -2,6 +2,7 @@ DMS File
 Document Module
 Graphic
 Image Module
+ImageDocument
 PdfDocument
 Presentation
 Role Definition
diff --git a/bt5/erp5_dms/bt/template_portal_type_workflow_chain_list b/bt5/erp5_dms/bt/template_portal_type_workflow_chain_list
index 94a2b64b61e00ae5f13a25aa94f4be8f6050baa7..a6014ea3c2ac529184ffe818afae59c653127d8c 100644
--- a/bt5/erp5_dms/bt/template_portal_type_workflow_chain_list
+++ b/bt5/erp5_dms/bt/template_portal_type_workflow_chain_list
@@ -7,6 +7,10 @@ Graphic | document_publication_workflow
 Graphic | edit_workflow
 Graphic | local_permission_interaction_workflow
 Graphic | ooo_interaction_workflow
+ImageDocument | dms_file_interaction_workflow
+ImageDocument | document_publication_workflow
+ImageDocument | edit_workflow
+ImageDocument | local_permission_interaction_workflow
 PdfDocument | dms_file_interaction_workflow
 PdfDocument | document_publication_workflow
 PdfDocument | edit_workflow