The most likely cause of "broken" images is being sloppy with the URLs. See the
JspFaq for information on properly addressing resources using server-relative URLs that begin weigh the context path.
And yes -- including servlet output in a JSP is a less-than-stellar practice.