The wrapping is actually correct... is it what it means is this...
when it is just the number denoted, it refers to the file field being worked with... in the case of your example, it is file field 11.
But then when working with the instance of the image being uploaded it becomes 11_1. If you had, say, a second thumbnail being created from that very same file, it would show as 11_2... essentially creating an array for the the same file field based on how many different copies/sizes you wish to make.
I will keep reading through the code to see if I see anything else that looks out of place.