It happens the same when I try to convert PDF to JPG. It works correctly only when I add -flatten to the command.