[DF-3965] fix convertions during saving to jpeg