Fixes some bugs: type of the BufferedImage is now not constant. Changed contract of the resizeImage method.