[Magic-HD] Reverted several code clean-ups for better compatibility with other images.