Let $\phi:A\rightarrow B$ be a morphism in a category, and $\phi':I\hookrightarrow B$ its image. Intuitively, $\phi$ should be an epimorphism if $\phi'$ is an epimorphism. But I have difficulty proving it using definitions of image and epimorphism (from Wikipedia). Is it true at all?
As usual with these things, it is not true in absolute generality. (Epimorphisms and images are very subtle creatures.)
Here is a counterexample. Let us have a category with five objects $A, B, C, D, E$, and non-identity arrows $A \rightrightarrows B$, $B \to C$, $C \to D$, $D \rightrightarrows E$, such that the composites $C \to D \rightrightarrows E$ are distinct while the pairs of composites $B \to C \to D \rightrightarrows E$ and $A \rightrightarrows B \to C$ are not distinct. By construction, $B \to C$ is not a monomorphism, $C \to D$ is a monomorphism and is the image of $B \to D$, while $C \to D$ is an epimorphism but $B \to D$ is not.
However, in any category in which (epimorphisms, monomorphisms) form an orthogonal factorisation system, your claim is true – for obvious reasons. For example, this is true in any topos and any abelian category.