I am trying to understand the following. Let $E/\mathbb{Q}$ be an elliptic curve with complex multiplication given by the ring of integers $\mathcal{O}_K$. We are given a fixed rational prime $p$ which is inert in $\mathcal{O}_K $. Then the image of the mod $p$ Galois representation $\overline{\rho}_{p,E}(G_\mathbb{Q})$ is conjugate to a subgroup of the normalizer of non-split Cartan.

The way I think about it is the following. We know End$(E)\cong \mathcal{O}_K$, hence there is an isogeny: $$ [\sqrt{-d}]: E \to E. $$ I would like to make a choice of basis for $E[p]$ such that the Galois action with respect to this basis gives an element of the normalizer of a non-split Cartan group.

Any help is much appreciated.