Shaping effects on toroidal magnetohydrodynamic modes in the presence of plasma and wall resistivity