If I understand correctly you have a camera which detects movement, but only want a picture sent if someone subsequently opens the gate. Perhaps the following flow will be applicable.
[{"id":"9b992c12.e3628","type":"switch","z":"e172e6c.abca718","name":"Front Gate \\n Opened","property":"Motion","propertyType":"flow","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":280,"wires":[["2725a094.e81d1"],["de495f7b.f2167"]]},{"id":"befee93c.022568","type":"inject","z":"e172e6c.abca718","name":"Door","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":130,"y":280,"wires":[["9b992c12.e3628"]]},{"id":"5ef34ef3.0f133","type":"inject","z":"e172e6c.abca718","name":"Snap","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$now()","payloadType":"jsonata","x":90,"y":640,"wires":[["136d9483.72219b"]]},{"id":"bfd53c9c.0d959","type":"debug","z":"e172e6c.abca718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":360,"wires":[]},{"id":"2725a094.e81d1","type":"change","z":"e172e6c.abca718","name":"Just me","rules":[{"t":"set","p":"payload","pt":"msg","to":"Just me","tot":"str"},{"t":"set","p":"Record","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":220,"wires":[["65348948.987928"]]},{"id":"de495f7b.f2167","type":"change","z":"e172e6c.abca718","name":"Visitor","rules":[{"t":"set","p":"payload","pt":"msg","to":"Hello","tot":"str"},{"t":"set","p":"Record","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":360,"wires":[["bfd53c9c.0d959","31df8720.f22a48","d5a61c6f.d45d3"]]},{"id":"a726cdcd.5bd2b","type":"change","z":"e172e6c.abca718","name":"Motion detected","rules":[{"t":"set","p":"Motion","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":640,"wires":[["b3cdf418.0269c8"]]},{"id":"d5a61c6f.d45d3","type":"change","z":"e172e6c.abca718","name":"Motion reset","rules":[{"t":"set","p":"Motion","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":500,"wires":[["6114b3db.4da73c"]]},{"id":"136d9483.72219b","type":"delay","z":"e172e6c.abca718","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":640,"wires":[["a726cdcd.5bd2b","74a46284.df212c","26fa440c.c2335c"]]},{"id":"74a46284.df212c","type":"file","z":"e172e6c.abca718","name":"Overwrite Last Snap","filename":"Snap","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":540,"y":720,"wires":[[]]},{"id":"b3cdf418.0269c8","type":"debug","z":"e172e6c.abca718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":660,"wires":[]},{"id":"6114b3db.4da73c","type":"debug","z":"e172e6c.abca718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":500,"wires":[]},{"id":"183b0614.94bd9a","type":"debug","z":"e172e6c.abca718","name":"Send to Cloud","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":440,"wires":[]},{"id":"65348948.987928","type":"debug","z":"e172e6c.abca718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":220,"wires":[]},{"id":"31df8720.f22a48","type":"file in","z":"e172e6c.abca718","name":"","filename":"Snap","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":630,"y":440,"wires":[["183b0614.94bd9a"]]},{"id":"26fa440c.c2335c","type":"delay","z":"e172e6c.abca718","name":"Nobody opened gate \\n within 5 sec \\n so reset flow.Motion","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":360,"y":500,"wires":[["d5a61c6f.d45d3"]]}]