Better resize handling for chip8 emulator