Try this. Please ensure that correct img reference is put in the change nodes before template node.
[{"id":"94e04e1250c9ced6","type":"group","z":"5a5b50a5e5a3beba","name":"","style":{"stroke":"#0070c0","fill":"#7fb7df","label":true},"nodes":["2f97bcf85d342764","c927bc7b220519c5","2a45ecfe85f1a2f0","80f12069ca3c11b4","1d6d3c3bc88a9a20","3aa625a28c6d4b18","67998388fd033959","690717b327e9c24d","cce9ee5c18f8627e","3609ad8d6cc1a7fa","005c9cb87751320d","d6f109aeda62055f","50c545146384375d","ae4352de98646b0b","31ca3099e671229f","88fc79f13ea3eae6"],"x":154,"y":921.5,"w":1247,"h":257},{"id":"2f97bcf85d342764","type":"inject","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"open","payload":"0","payloadType":"num","x":250,"y":962.5,"wires":[["1d6d3c3bc88a9a20","d6f109aeda62055f"]]},{"id":"c927bc7b220519c5","type":"inject","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"open","payload":"1","payloadType":"num","x":250,"y":1006.25,"wires":[["1d6d3c3bc88a9a20","d6f109aeda62055f"]]},{"id":"2a45ecfe85f1a2f0","type":"inject","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"close","payload":"0","payloadType":"num","x":250,"y":1093.75,"wires":[["1d6d3c3bc88a9a20","50c545146384375d"]]},{"id":"80f12069ca3c11b4","type":"inject","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"close","payload":"1","payloadType":"num","x":250,"y":1137.5,"wires":[["1d6d3c3bc88a9a20","50c545146384375d"]]},{"id":"1d6d3c3bc88a9a20","type":"join","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":425,"y":1050,"wires":[["3aa625a28c6d4b18"]]},{"id":"3aa625a28c6d4b18","type":"switch","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Open","property":"payload.open","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":575,"y":1050,"wires":[["690717b327e9c24d"],["67998388fd033959"]]},{"id":"67998388fd033959","type":"switch","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Close","property":"payload.close","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":725,"y":1075,"wires":[["005c9cb87751320d"],["3609ad8d6cc1a7fa"]]},{"id":"690717b327e9c24d","type":"switch","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Close","property":"payload.close","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":725,"y":1000,"wires":[[],["cce9ee5c18f8627e"]]},{"id":"cce9ee5c18f8627e","type":"change","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Open:0 Close-1 \\n OPEN","rules":[{"t":"set","p":"img","pt":"msg","to":"/ouvert.png","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":975,"wires":[["88fc79f13ea3eae6","ae4352de98646b0b"]]},{"id":"3609ad8d6cc1a7fa","type":"change","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Open:1 Close:1 \\n PARTIALLY OPEN","rules":[{"t":"set","p":"img","pt":"msg","to":"/portillon.png","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1125,"wires":[["88fc79f13ea3eae6","ae4352de98646b0b"]]},{"id":"005c9cb87751320d","type":"change","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Open:1 Close:0 \\n CLOSED","rules":[{"t":"set","p":"img","pt":"msg","to":"/ferme.png","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":1050,"wires":[["88fc79f13ea3eae6","ae4352de98646b0b"]]},{"id":"d6f109aeda62055f","type":"debug","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Open","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":435,"y":975,"wires":[]},{"id":"50c545146384375d","type":"debug","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Close","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":450,"y":1125,"wires":[]},{"id":"ae4352de98646b0b","type":"template","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<div>\n<img src={{img}} width=\"1200px\" height=\"650px\" style= \"margin: 5px 5px 5px 5px\"; >\n</div>\n","output":"str","x":1140,"y":1050,"wires":[["31ca3099e671229f"]]},{"id":"31ca3099e671229f","type":"ui_template","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","group":"4d8299c5b5c503de","name":"","order":7,"width":0,"height":0,"format":"","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1315,"y":1050,"wires":[[]]},{"id":"88fc79f13ea3eae6","type":"debug","z":"5a5b50a5e5a3beba","g":"94e04e1250c9ced6","name":"Output","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1150,"y":975,"wires":[]},{"id":"4d8299c5b5c503de","type":"ui_group","name":"Ouverture du portail exterieur","tab":"40264fa5a0eade36","order":1,"disp":true,"width":"25","collapse":false,"className":""},{"id":"40264fa5a0eade36","type":"ui_tab","name":"Gestion des portails ","icon":"dashboard","order":1,"disabled":false,"hidden":false}]