This is embarrassing but I seem to be having trouble with the first isomorphism theorem.

I'm reading stuff about endomorphisms' kernels and images being direct summands of a module. I haven't seen any explicit statements but the authors clearly imply that whether the kernel is a direct summand is indepentent from whether the image is. I don't understand why.

If I have a direct sum of two modules K\oplus L isn't it always true that (K\oplus L)/K is isomorphic to L? Let \phi:[(k,l)]\longmapsto l,\,\phi: (K\oplus L)/K\longrightarrow L. \phi is clearly an isomorphism, isn't it? I've checked twice and I can't see why it wouldn't be.

But then, for f:M\longrightarrow M, if \ker f is a direct summand of M, say M\cong\ker f \oplus N, and I get

N\cong (\ker f \oplus N)/\ker f\cong M/\ker f \cong \mathrm{im} f

from the first isomorphism theorem. Which would mean, in particular, that \mathrm{im} f is a direct summand of M too. What am I doing wrong?

(I'm sorry if it's not very readable. I hope it is but it's 4.30 am here and I barely see anything.)