Because the browser will use the source of the image element to fetch the image file, it must be able to be served by URL.
If the file itself can't be served for whatever reason, you can write a
servlet that reads the file and serves it.
See the Servlet forum as this has been discussed many times.