some error checking before binding textures.