changed the DOM handling
added support for images with parameter strings (used by some galleries)
extended check for the IMAGETYPE_XX