Turns out that the .item(i) was successfully selecting the object of the part in that index. I needed to use .filename method to get the actual name.