Hello,
phpdocx uses an internal class to download images when using replaceVariableByHtml. Please check that the downloadImages option is set to true, that images are publicy accesible (phpdocx uses file_get_contents, so this access can be done through any supported stream: HTTP, FTP...) and that the strem of the image can be accessed (if you are using an URL to access the image maybe you need to set a baseURL value).
Regards.