It looks like your bottles were not 100% clean.
1. Soak the bottles in PBW or washing soda (lots cheaper) overnight.
2. Use a bottle brush to clean the inside well and a stiff brush to remove glue residue from the outside.
3a. Rinse out with very hot water, inspect for cleanliness.
Use one of those faucet jet cleaners. They work wonders to rinse the inside.
If you need to store them, do so in a way to keep them clean.
3b. I prefer to give them another PBW or washing soda wash with the bottle brush or jet spray if they've been sitting around for a while. You want to be sure they are 100% clean.
4. Once clean, right before bottling, sanitize inside and out by immersing in a plastic tote with Starsan (my preference) or Iodophor.
5. Drain the remaining Starsan by placing the sanitized bottles upside down on a sanitized countertop, or sanitized bottle tree and fill with beer using a bottle filler. Keep everything well sanitized.
6. Cap with clean and sanitized caps.