Added support for PNGs, filename extensions if unable to determine from image data, more error checking