Here is a way you could do it (if I understand what you want) This assumes you are using the ui-template node.
First you have to use msg.topic (or something else) to pass an even or odd value and with the payload (which is the image location) Next you have to add an ng-style to both <a…> statements like this:
<a ng-style="{display: (msg.topic || 0) % 2 === 0 ? 'none' : 'block'}" href="http://192.168.1.156:8081" target="_blank">Local</a>
<a ng-style="{display: (msg.topic || 0) % 2 === 0 ? 'block' : 'none'}" href="http://mydomain:8081" target="_blank">Remote</a>
What this will do is if the value is ODD, the <a…> for the local camera will display and the <a…> for the remote will NOT display. If the value is EVEN, the <a…> for the remote camera will display and the <a…> for the local will NOT display.
This is my test flow showing this you will have to change the url for your image in the change node:
[{"id":"f9e3e4e8.c9d9a8","type":"ui_template","z":"9728229a.e316b","group":"c802ad.2e912d5","name":"","order":0,"width":"9","height":"9","format":"<div>\n<a ng-style=\"{display: (msg.topic || 0) % 2 === 0 ? 'none' : 'block'}\" href=\"http://192.168.1.156:8081\" target=\"_blank\">Local</a>\n<a ng-style=\"{display: (msg.topic || 0) % 2 === 0 ? 'block' : 'none'}\" href=\"http://mydomain:8081\" target=\"_blank\">Remote</a>\n<img src= {{msg.payload}} width=\"280\"><br/>\n\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":460,"y":160,"wires":[["e9e45c4.75022a"]]},{"id":"10695bd2.a74f54","type":"inject","z":"9728229a.e316b","name":"Local Camera","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":80,"wires":[["888b7571.b440c8"]]},{"id":"c97db1ce.df44e","type":"inject","z":"9728229a.e316b","name":"Remote Camera","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":220,"wires":[["888b7571.b440c8"]]},{"id":"e9e45c4.75022a","type":"debug","z":"9728229a.e316b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":680,"y":160,"wires":[]},{"id":"888b7571.b440c8","type":"change","z":"9728229a.e316b","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"topic","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"http://localhost/pmw.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":160,"wires":[["f9e3e4e8.c9d9a8"]]},{"id":"c802ad.2e912d5","type":"ui_group","z":"","name":"Default","tab":"40e4dd7b.57ed44","disp":true,"width":"12","collapse":false},{"id":"40e4dd7b.57ed44","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]