There is always risk with any surgery but the longer you wait the greater the risk of sending you into early labor. At only 3 months the surgery is not as invasive as if you are say 32 weeks. Then they have to make the old cut across your stomach.
No surgery is ideal during pregnancy, but gallbladders can often be removed laproscopically so will be mimally invasive to the developing fetus. The larger concern is the general anesthesia required to prepare for surgery. Discuss with your doctor any alternatives and get second opinion. If the gallbladder is not likely to rupture, consider dealing with the discomfort until after delivery.
The sooner the procedure is done the better, because then the uterus does not get in the way and complicate the surgery. Anesthesia however is always a concern during pregnancy.