Moved buffer sizes to static variables and shrank the 16MB in PNGEncoder to 1MB.