Dangerous school buildings to be reconstructed