Fixed memory leak
CGM working now. Need to do checks of how operates, but this is independent of
using a uint8_t array for pixel data