Change cleanContent to use preg_replace_callback instead of preg_match_all
this significantly improves performance for large image based PDF's and reduces memory requirements.