Lattice-driven magnetoresistivity and metal-insulator transition in single-layered iridates