Bug 983172 - Parsing jpeg header information for downsampling the image for thumbnail, r=azasypkin