Issue #976436 by matheusgorino, soxofaan: Adds an ob_end_clean to prevent the output image from being corrupted.