Added simultaneous output of jpg