Added optionaly mid-gray fix, BMP to GIF fix