Given C*-algebras $\mathcal{A}$ and $\mathcal{B}$.
Consider a morphism: $\pi:\mathcal{A}\to\mathcal{B}$.
Then its image is closed: $\mathrm{im}\pi\subsetneq\overline{\mathrm{im}\pi}$
The proof I know critically uses $\pi[1]=1$.
But what if either $1\notin\mathcal{A}$ or $1\notin\mathcal{B}$ or $\pi[1]\neq1$?
Let $C$ be the C*-algebra generated by $\pi(A)$. Then $\pi(1)$ is a multiplicative identity for $C$, because it is one for $\pi(A)$ and multiplication is continuous. Now you can apply the proof you know to $\pi:A\to C$.