Let $\mathcal{A}$ be an abelian category. Show that for every $f:A\to B$ the following sequences are exact:
$$0\to \text{ker}(f)\xrightarrow{i} A\xrightarrow{\pi}\text{coim}(f)\to 0$$ $$0\to \text{im}(f)\xrightarrow{j} B\xrightarrow{\rho}\text{coker}(f)\to 0$$
I've used the universal properties of $\text{ker, im, coim}$ and $\text{coker}$ to prove that $i, j$ are monomorphisms and $\pi,\rho$ are epimorphisms.
But I have no idea how to prove that $\text{ker}(\pi)=\text{im}(i)$ and $\text{ker}(\rho)=\text{im}(j)$. In explicit cases, like in the categories of $A$-modules or groups, we obviously have that $\text{im}(i)=\text{ker}(f)=\text{ker}(\pi)$, for example. But in general, I don't even know where to begin.
What is the idea?