Added some more code for tinting images