private function setDimensionsFromParent(EngineImage $sourceImage, Node $node)
 {
     $parent = $node->getParent();
     $width = $sourceImage->getOriginalWidth();
     $height = $sourceImage->getOriginalHeight();
     if ($width > $parent->getWidth() || $height > $parent->getHeight()) {
         if ($parent->getWidth() > $parent->getHeight()) {
             $height = $parent->getHeight();
             $width = null;
         } else {
             $width = $parent->getWidth();
             $height = null;
         }
     }
     return array($width, $height);
 }