Good that your problem is solved. Just a few notes on the code:
open ($myimage, "$imagelocation") or die "cannot open";
This being a web thing, it may be intentional that you limit the info exposure, but it can be easier if you include what happened in the error message:
open ($myimage, "$imagelocation") or die "cannot open: $!";
Also, you can condense the output loop down to a single print:
print <$myimage>;
<filehandle> in list context returns all the lines, and print is list context, outputting all the items in its list. And since a binary file doesn't exactly have lines anyway...