Avoid NPEs when no filename is set on the UserAgent. Only the first page is rendered in this case. The resolution is written to the PNG file.