Photoproduction and rescattering of polarized hyperons in deuterium