Changed output from .png to .hdr (RGBE format)
Added RGBE code from http://www.graphics.cornell.edu/~bjw/