Algorithmen (load, store and display) an Image. Out a database source to JSF Page sink - at runtime

I worked for a while on an Algorithmen to load to, to store to and to display to, an Image within a Browser application at runtime.
The image was once streamed into a database table binary-stream field. As far as good!
But, the Alogorithmen solved the load, store and display not. The approach to solution was tried with JSF (Woodstock) Components.
Applied within a JSF Tree (Woodstock) Component on a JSF Page, the Image names were linked to the database URI.
A users mouse-click on an event attached to every Image names was starting a sequence to load to, to store to and to display to the Image to the JSF Page.
What would made the Algorithmen work correctly at runtime (cause I know, it's a very simply analysis problem) using NetBeans 6 on board resources at development time?