Opening entrada/images.txt in write mode instead of append