Added support to test for gif, png, or jpeg output and if bands are greater than 3 then map to 3 band
Added try catch so we can catch any problems
Added the proper _=