Web images are always fetched via separate URLs. That's what the HTML image tag and its corresponding h:graphicImage tag do, is define the URL from which the image is going to be retrieved.
If your image is already stored in a supported binary image format (such as jpg or gif) within the WAR, all that's needed is to construct a URL that references this image resource.
If you are pulling the image from a BLOB in a database or dynamically constructing the image - for example, as a graph - then you will have to construct a temporary image resource and provide a URL mechanism that retrieves the content of that image.
JSF itself will not be aware of which of the above you are using, since in both cases, a URL is the means of access. Merely that in one case you are using the webapp server's default URL resolution functions and in the other, you're providing a URL resolution function of your own.
An IDE is no substitute for an Intelligent Developer.
I agree with the above comment and doing so will increase performance. If you are intended to load from Data base then you have to read BLOB from data base using InputReader, BufferReder and set that value in the <h:graphicImage />tag of JSF.