Fixed size issues, removed BufferedImage converter, reformated the code