Recent versions of CGI.pm default to producing XHTML output. Non-bracketing tags like your <img tag end with />. This is compatible with typical HTML browsers because of the space preceding it.
<rant>
I've always strongly disliked (hated?) CGI.pm
because of its HTML producing bloat. Now that's doing
XHTML nonsense (goddammit, the fact typical browser authors
can't parse their way out of a wet paper bag isn't a reason
to violate standards - XHTML is not, and will never be, HTML)
I've one more reason to burry CGI.pm under several cubic
miles of concrete.