microsoft word – How would I use IF statements to select which image to pull through using Mergefields?

I’m trying to export images from a database record to a Word document. The record includes a primary photo, which appears on the front page, and then the additional photos are attached to the end of the document after all of the other information.

When I export the additional photos, it is appending the primary photo to the end of the list of photos. Is there a way that I can run an IF statement to skip this image if it is also the primary photo?

At the moment, this is where I am at :

{ IF {MERGEFIELD Picture} = {MERGEFIELD PrimaryPicture} "" "{MERGEFIELD Picture}" }

I have also attempted the following with no luck either :

{ IF {MERGEFIELD Picture} <> {MERGEFIELD PrimaryPicture} " {MERGEFIELD Picture} " ""}

Any guidance would be greatly appreciated!