lua : fix a bad case of use before init
#10097: uncommon .jpeg files aren't RAWs
Add groupid & flags to image information lib

This is mostly for debugging purposes, so we migth #ifdef it out when
building from a source package and only leave it in when compiling from
git.