Updated process images class to use DOMDocument