Gallbladder surgery can be performed when gallstones affect body health or when there is pain in the gallbladder.