Ligand-engineered bandgap stability in mixed-halide perovskite LEDs