Are the “power word” spells an attack, and how do they interact with mirror image?


Mirror Image (p260 PHB) Says:

Each time a creature targets you with an attack during the spell’s duration, roll a d20 to determine whether the attack instead targets one of your duplicates….

….A duplicate can be destroyed only by an attack that hits it. It ignores all other damage and effects.

Power Word Spells (p266-267 PHB)say:

You utter a word of power that can compel one creature you can see within range…

…Otherwise, the spell has no effect.

I can see this going one of two ways.
Either Mirror image has priority and you roll to see if a reflection is targeted by the Power Word Spell in which case it has no effect.

OR

Power Word has priority and because you see the target even tho there are duplicates, the power word effect takes place and ignores mirror image.

Which is correct?