I would not recommend the antibiotics from the pet store. Hamsters have a variety of antibiotic sensitivities (very similar to guinea pigs). It's better to have a correct antibiotic from the vet that won't make them ill.
We are as gods to the beasts of the fields. We order the time o' their birth and the time o' their death. Between times, we ha' a duty. - Terry Pratchett.
"Men have forgotten this truth", said the fox, "But you must not forget it. You become responsible, forever, for what you have tamed. - Antoine de Saint-Exupéry