refactored textures.lua

cleaned up redundant code, improved variable names, fixed dodgy textures