figured out proper scoping for looped texture loading

works now, thanks to jpark