Fix removebracket bugs in image-based math display