Transition from strong to ultrastrong coupling regime in mid-infrared metal-dielectric-metal cavities