added a fast check for JPEG headers to filter out non jpg images..