I have migrated a CGI Perl script from Apache to IIS. The calling script file makes a call to the CGI script that generates the image via an <img> HTML tag and the script that generates the image uses $query->redirect on the CGI object before exiting. On Apache, everything works fine. On IIS a broken link appears in place of the image until a subsequent refresh if issued indicating that perhaps the page is displaying before the image is generated. What is the best method to fix this script so a manual refresh isn't required?