the drop down box for the first file is ok,
for the 2nd file, it shows it twice,
for the 3rd, it shows it 3 times,
4 times for the forth image & 5 times for the 5th image...
Without the code change, if you uploaded multiple images it would add the categories to the previous categories list. With the change it should fix it.