Added hook for win when wirting jpg.