This cannot happen in a regular category. Below I give a proof using the sequent calculus of subobjects in a regular category. It can be deciphered using the book 'Sketches of an Elephant Volume 2' by Peter T. Johnstone, in particular chapter D1.

I write $\beta:=I$ and $\gamma:=J$. I hope the definition of image given in your book is the same as mine, namely the image of a subobject (~mono) $S$ under a morphism $\phi$ is the least subobject of the codomain of $\phi$ through which $\phi\circ\overline{S}$ factors, where $\overline{S}\in S$.

Assume we know
$\exists x(\alpha(x)\wedge f(x)=y) \dashv\vdash_{y:Y}\quad \beta(y)$ and $\exists y(\beta(y)\wedge g(y)=z) \dashv\vdash_{z:Z}\quad \gamma(z)$. We then want to prove two things. The first is that $\exists x(\alpha(x)\wedge g(f(x))=z)\vdash_{z:Z}\quad \gamma(z)$, the second that $\gamma(z)\vdash_{z:Z} \quad \exists x(\alpha(x)\wedge g(f(x))=z)$.

For the first we have the following.
$\alpha(x)\wedge g(f(x))=z$
$\vdash_{x:X,z:Z} \quad\alpha(x)\wedge g(f(x))=z \wedge f(x)=f(x)$
$\vdash_{x:X,z:Z}\quad \alpha(x)\wedge g(f(x))=z \wedge \beta(f(x))$
$\vdash_{x:X,z:Z}\quad \gamma(g(f(x)))$. Therefore $\alpha(x)\wedge g(f(x))=z\vdash_{x:X,z:Z}\quad \gamma(z)$ and hence $\exists x(\alpha(x)\wedge g(f(x))=z)\vdash_{z:Z}\quad \gamma(z)$.

The second also holds. First note that $\beta \wedge g(y)=z$
$\vdash_{y:Y,z:Z}\quad \exists x(\alpha(x)\wedge f(x)=y)\wedge g(y)=z$
$\vdash_{y:Y,z:Z}\quad \exists x(\alpha(x)\wedge f(x)=y\wedge g(y)=z)$
$\vdash_{y:Y,z:Z}\quad \exists x(\alpha(x)\wedge g(f(x))=z)$ from which we may conclude that $\gamma(z)\vdash_{z:Z} \quad \exists y(\beta(y)\wedge g(y)=z)\vdash_{z:Z} \quad \exists x(\alpha(x)\wedge g(f(x))=z)$.