Cherry-pick (with changes) Craig's commit to fix the USB image creation.
Ticket: #5184