Yeah, your counterexample looks good.
In general if you have groups $G$ and $H$ you can consider the morphism $\varphi: G\rightarrow H$ defined by $\varphi(g)=e_H$ for all $g\in G$.
The image is $\\{1_H\\}$ and the kernel is $G$. So this is a valid counterexample whenever $G$ is not trivial.