Quasi-free photoproduction of charged pions from copper and lead