Upgrade JPEG metadata extractor code and centralize function