Improves Document editing with Image

Errors with the Image db creation in editDocument() method