Interplay Between Structural Dynamics And Optoelectronic Properties In Lead Halide Perovskites