REVERSE ME LATER: Upgrade JPEG metadata extractor code and centralize function (reverse-merged from commit 80256fa0ec44c9e9cb93095feccf3a33b179a498)