update petes code, don't try to output jpg files to stdout