Potential fixes to improve memory usage with BufferedImages