There can be other bugs causing kidney and bladder infections, but E. coli infection, usually from faeces, is a common cause. As has been said often, it's poor design - women's bodies have the playground too close to the waste disposal facility! Men have an extra 7" of protection.
Don't let the type of bug worry you - it is one of those things very difficult to prevent. Having gallstones as well probably doesn't help; they hurt a lot as well, a fait bit of your pain could well have been referred pain from your gall bladder.
I mentioned prevention - there are some good tips on how to prevent a urinary tract infection (Urinary Tract Infection (UTI)) especially one caused by E. coli:
1) The first and most important rule is to empty your bladder within fifteen minutes of having sex. When you have sex, the various movements can actually push bacteria up into the urethra and into the bladder. It's like getting an ear of barley or wheat and inserting it into your sleeve at the wrist, stalk first. You swing your arm, you try and shake it out, but all this does is make the wheat move up your arm. Within minutes it is up at the shoulder.
2) Next important step - when you wipe after going to the toilet, wipe from front to the back. Do you utmost to keep the areas separate in your personal hygiene. If you have recurring problems you may need to up the ante with personal hygiene and carefully wash yourself (and then dry yourself) after using the toilet.
3) Drink at least 2 litres of water a day (that's a bit over 3 pints). And that's water, not sugary or salty fluids. You need to keep osmosis in mind and avoid water with other stuff in it that will slow down osmosis.
4) Take cranberry in some form, regularly. Research indicates that cranberry taken regularly actually 'tans' the bladder wall and helps protect it form bacterial invasion. The bugs can't get a grip. That's what my kidney specialist tells me, anyway.
As for the gall bladder, I can't help you there except to offer sympathy and to tell you what you probably already know - avoid fatty food. But chances are, even the mention of a greasy pork chop and friedeggs is aggravating your pain so I will shut up now.
Hang in there, I hope the docs can fix you up.
Marg