These two pictures give a reasonable description of how cosets work, but they are not really suitable for explaining why normal subgroups and ideals are "analogous."
These two diagrams say, in effect, "$G$ can be split up into chunks (cosets) and $gH$ is basically $H$ translated by $g$. These two translations are different in general, but when $H$ is normal, multiplying on the left and the right unambiguously translate $H$ to $gH=Hg$."
But that is basically where the usefulness of looking at the internal structure of cosets ends. The fruitful path is to then ask "Is there some obvious structure that makes the set of cosets more than a set? Can I make it into a group or a ring?"
For groups, the obvious candidate for $aH\cdot bH$ is $abH$. But as you probably know, this isn't well defined unless $H$ is normal in $G$.
If $R$ is a ring and $I$ is an ideal, then not only do we need $I$ to be a normal subgroup of $(R,+)$, so that $(a+R)+(b+R)=a+b+R$ is well defined, we also need $(a+r)(b+R)=ab+R$ to be well defined. It turns out that the absorption properties of ideals are exactly saying that this multiplication is well defined, so that the set of cosets becomes a ring.
Once you make the set of cosets into a group (or a ring) then you can talk about the homomorphism $G\to G/H$ and $R\to R/I$, and see that $H$ is the kernel of the first homomorphism, and $I$ is the kernel of the second homomorphism. This gives an equivalent way of looking at normal subgroups and ring ideals: they are precisely the kernels of homomorphisms. This viewpoint is probably the most unifying of the two ideas (and indeed many more.)
Later on, conditions on the quotient $G/H$ (or $R/I$) can circle back to be conditions on $H$ and $I$. When learning about the two concepts in general for the first time, though, it makes more sense to focus on what these two definitions mean for the quotient, and not for the internal structure of each coset.
What you want is the notion of a congruence. It's a convenient fact about groups resp. rings that congruences are equivalent to normal subgroups resp. (two-sided) ideals; in general, for example when dealing with monoids, you really need to work with congruences.
Best Answer
The answer is that in general there are many such homomorphisms, but from a certain point of view the canonical projection $\pi:R\to R/I$ is essentially the only homomorphism with kernel $I$, in the following sense:
Canonical decomposition of ring homomorphisms: Let $f:R\to S$ be a ring homomorphism, and consider the canonical projection $\pi:R\twoheadrightarrow R/\ker f$ and the inclusion $i:\text{im }f \hookrightarrow S$. There exists a unique isomorphism $\tilde f:R/\ker f\to \text{im }f$ such that $$f=i\circ\tilde f\circ\pi $$ i.e. the following diagram commute:
$\require{AMScd}$ \begin{CD} R @>{f}>> S\\ @V{\pi}VV @AA{i}A\\ R/\ker f @>{\tilde f}>> \text{im }f \end{CD}
(You may have called an equivalent result first isomorphism theorem, even if this formulation is slightly more general and insightful, in my opinion).
Now, if $f:R\to S$ is any ring homomorphism with $\ker f=I$, then $f$ is equal to the canonical projection $\pi:R\to R/I$ followed by an isomorphism and an inclusion. Hence any different ring isomorphism $\tilde f:R/I\to T$ where $T$ is a subring of any ring $S$ gives rise to a different ring homomorphism $f:R\to S$ with kernel $I$ (by composition with $\pi$ on the right and $i:T\hookrightarrow S$ on the left). For example, if you consider the ideal $(0)$, all injective ring homomorphisms $f:R\to S$ have kernel $(0)$: therefore in general there are lots of such homomorphisms, even though they are all the same, in the sense specified above.
In fact the question is slightly more sophisticated: all these different homomorphisms are actually the same, up to relabeling elements and extending the codomain, so that often we can just ignore them. However, if we fix the codomain (in such a way that we cannot "cheat" anymore extending it or considering an isomorphic one), the different homomorphisms with kernel $I$ are still equivalent up to isomorphism, but the number of them can be an insightful source of "algebraic information"
For example, there are exactly two homomorphisms $\mathbb{Q}[x]\to \mathbb{R}$ with kernel $(x^2-5)$, defined by sending $x$ respectively to $\sqrt{5}$ and $-\sqrt{5}$, but there is only one homomorphism $\mathbb{Q}[x]\to \mathbb{R}$ with kernel $(x^3-2)$ (defined by sending $x$ to $\sqrt[3]2$). These observations are crucial in field theory.