Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
The replacement of images in templates does not work in more complex templates than the ones inlcuded in the examples. In the code you assume that there are as many docPr tags as there are blib tags. This is not true. Textboxes for example also generate docPr tags but no blib tags. The count of the two node lists is different causing an exception in the replaceImages method.
You might want to try your template code with some more real world examples to see, if there are more issues like this one..