This article shows one way to implement a fallback image if the URL for the primary image is not found. It is however recommended to use the error handling option on the image element (for the URL option) instead of the setup below.
You can include a dynamic image in InterformNG2 by e.g. concatenating fixed strings with dynamic information from the input file e.g. like so:

The Xpath expression above:
concat('file:/D:/images/',./DocumentNo,'.jpg')- It builds the path to the image with the initial string: file:/D/images/ and the ending string: .jpg. In the middle we insert the contents of the DocumentNo subnode of the currently selected node in the input XML file. If the DocumentNo node e.g. has the value 1001, then this expression will try to use the image in D:/images/1001.jpg.
- If this image file does not exist, then the rendering will stop with an error.
- It is possible to verify if the image file exist and decide to insert another (or no) image instead, if the primary image does not exist.
- If you want to do that, then you can use the ng:fileExist() function to verify if the image file exists or not.
A solution could look like this:

In the example above we test if the image file exist: If it does exist, then we insert the dynamic image
concat('file:/D:/images/',./DocumentNo,'.jpg'),but if the image does not exist, then the image /Intro/logo.jpg is inserted instead.
Each element is shown below:
The select element

The dynamic image

The fixed fallback image
