[[ RefactorGraphics ]] Fix crash after flipping resident image due to uninitialised mask buffer