The influence of pore wettability on the dynamics of imbibition and drainage