Added some code to dealwith both alpha'd and non-alpha'd textures