some texture loading improvements