Descartes postion holds with respect to the imaginary. What he is showing in the argument is not the existence of God, but the self-sufficiency of reason.
God's perfection is an account of reason and knowledge itself. Descartes has a concept of the difference between a truthful experience and a falsehood. How is a truthful experience distinguished from a false one, despite them seemingly being inseperable in appearance?
The truthful reflects the perfection of God (and reason) It's the difference between an experience truthful about the world and"illusion" of the evil demon. In God, Descartes is effectively posing both a conceptual realism and empirical one. Truths are defined on the basis independent from experience or a representation.
Comparing this to Sartre, Descartes God is much like the existence which precedes essence. For Descartes, God is the reason for saying one thing is true rather than another, much like one's own existence and choices are for Sartre.
In this respect, Descartes argument holds even for the context of imaginary things. What am I imagining? In trying to answer this, I am trying to give not just an experience of some imagining, but a description of what I have imagined.
So what makes it true I have imagined something? It cannot be just an experience or representation I imagined it. Anyone might have that experience as an illusion. I need the reason for why it would describe me or not.
For Descartes, this reason is what I imagined is in the perfect mind of God. That's to say, the truth of what I imagined is defined independent of my representation. Or in Sartrian terms: I existed (and chose) imagining this.
A "perfection" which cannot be countered because it would for a contradiction in reason. If concept a reflects what is true in the perfect, all knowing mind, it's a contradiction to say it false. Similarly, if we try to say something than your own choices (and existence) are responsible for your being, we will find a contradiction.