# computation in exact sequence of abelian groups

Suppose we have this exact sequence of abelian groups $$G_1\xrightarrow{f} G_2\xrightarrow{g}G_3\xrightarrow{h}G_4\xrightarrow{k}G_5.$$

I need to compute $G_3$ and I only know the expression of $f$ and $k$ which are both injective group homomorphisms. Can I say that $G_3={G_2\over \mathrm{Im}(f)}$, and so it remains to compute only $\mathrm{Im}(f)$?

My guess is yes. Since $k$ is injective then $\mathrm{Im}(h)=\ker(k)=0$ hence $h$ is the zero homomorphism sending each $g\in G_3$ to $0$ hence $\ker(h)=G_3=\mathrm{Im}(g)$. Now ${G_2\over \ker(g)}\cong \mathrm{Im}(g)=G_3$ hence $G_3\cong {G_2\over \mathrm{Im}(f)}$. Is my reasoning correct? Is there any other simpler way to do this?

-