A wizard has a projected image. The wizard tries to cast a spell through the projected image.
Someone else has an action ready to cast a dispel magic to counterspell the wizard. The dispel magic spell description reads:
You choose to use dispel magic in one of two ways: a targeted dispel or a counterspell.
Counterspell: When dispel magic is used in this way, the spell targets a spellcaster and is cast as a counterspell. Unlike a true counterspell, however, dispel magic may not work; you must make a dispel check to counter the other spellcaster’s spell.
What happens when he casts the dispel?
Does it affect the spell or the projected image?
If it affects the image, what happens to the cast spell? Is it lost?