Merge pull request #2 from pkrnjevic/dev

Memory jpeg output fix