fixed motion jpeg output, fixes #359