Also some corrections to your code:
1) check if cat is null, or you will get into problems.
2) you can't use File with an http:// URL. Instead, you should use the following code: ServletContext's getRealPath method will translate the path, relative to your web application, to a real file path. In this case, it would be C:\<Path to Tomcat>\webapps\WebApplication1/image/<filename> on Windows.
3) don't mix response.getWriter() and response.getOutputStream(). Simply remove setting the first content type, and every reference to out.
4) your code is vulnerable to path injection. Suppose the filename is ..\..\..\..\..\..\..\..\..\..\Windows\win.ini - that could allow the user to retrieve C:\Windows\win.ini. With other examples, the user could retrieve important system files. Make sure that you validate the file name first.