Fixed image piping code for Windows