Refactored code allocating memory for the CImgDisplay in the CHIP8state struct