Multipole analysis of pi-zero and pi-plus photoproduction between threshold and 500 MeV