fixed texture loading out of bounds errors and formatting