Gallstones can block the common bile duct, which takes bile from the cystic and hepatic ducts to the small intestine. This can cause inflammation of the ducts.