Pore geometry control of apparent wetting in porous media