Twiglett, my copy of the British National Formulary (which your dr should have!) says erythromycin is not known to be harmful in pregnancy. That is not the same as saying it's completely safe, but as it would not be ethical to run trials on pregnant women they have to go on reported problems,there have been none. The same applies to penicillin. Both have been around for many years, and seem to be quite safe as far as anyone can tell.
The question is, whether your chest is bad enough to warrant antibiotic treatment, if it is, (and got better on your other course) I would say take them, they are quite safe.
As for Xrays, if you have to have an Xray, they will cover your belly wih a lead apron to shield the baby. The most risk with Xrays is in the first trimester, when all the organs etc are developing, your baby will be a mini fully formed human being by now. If a baby was born very premature at 26 weeks, they would get Xrays as part and parcel of the intensive care, so one chest Xray is highly unlikely to cause any problems.
HTH