Refactor parsing of APP markers

To make the parsing of APP markers more robust (e.g., the order doesn't seem to be set in stone), checkImageHeader now doesn't care which APP markers there are except for the APP1 Exif marker which is the one we want for the Exif data. Just go through every APP marker and if we come across an APP1 Exif marker we save the offset to its Exif data header.