diff --git a/modules/document/document.item.php b/modules/document/document.item.php
index 94bd205b1..8c4bccc3d 100644
--- a/modules/document/document.item.php
+++ b/modules/document/document.item.php
@@ -837,8 +837,19 @@ class documentItem extends Object
// If not specify its height, create a square
if(!$height) $height = $width;
+ if($this->get('content'))
+ {
+ $content = $this->get('content');
+ }
+ else
+ {
+ $args = new stdClass();
+ $args->document_srl = $this->document_srl;
+ $output = executeQuery('document.getDocument', $args);
+ $content = $output->data->content;
+ }
// Return false if neither attachement nor image files in the document
- if(!$this->get('uploaded_count') && !preg_match("!
get('content'))) return;
+ if(!$this->get('uploaded_count') && !preg_match("!
get('content');
$target_src = null;
preg_match_all("!src=(\"|')([^\"' ]*?)(\"|')!is", $content, $matches, PREG_SET_ORDER);
$cnt = count($matches);