Okay. I found the precise cause of the JPEG problem and its solution.
main.js wrongly defaults to ".jpg" for thumbnail file extensions when the file type is anything other than a "png" or "PNG". To correct this it need two "else if"s inserted to account for jpegs and gifs. Pic related.
Someone gets CM's attention.