Folded bash script into program, now self-contained CGI script. Requires ImageMagick, however.