Ugh. Roseindia is full of buggy code and bad practices, and this one is no exception. Stuff like this should never be done in JSPs, but in
Java code.
As to image resizing, this should help:
The Perils of Image.getScaledInstance(). You can create a BufferedImage from the uploaded data by using one of the javax.imageio.ImageIO.read methods.