If you have an inflamed pancreas, a severe infection or other complications from gallstones, you may need surgery to remove your gallbladder.