Faster Mat to BufferedImage convert and removed memory leak fix