Ignore .mat files.
Split reading images into header and images.
Fixed bug where image dat gets filled in with background_dat.
Now images get UID, even without reading all images, thanks to headers.