You normally don't use JSF to store an image in a DB. You normally use JDBC for that.
If your actual problem is that you don't know how to upload a file (image) with JSF, then you should say that so. There are component libraries out for uploading files with JSF, for example Tomahawk t:inputFileUpload. Just get an InputStream of the uploaded file and persist it in the DB using JDBC's PreparedStatement#setBinaryStream().