Affine pi-rings have gabriel dimension