DOC: restore emacs comment line

I deleted it by accident somehow.
RF: refactor image type detect into own function

From suggestion by Yarick - move image type detection into it's own
function in case someone wants to use it without loading the image.
Extend tests by testing against the example data.