I don't think you should pass the real metadata object in this case because we're just passing the preview blob. So wouldn't that alter the metadata object incorrectly? 

Just above this line we pass a function wrapped around metadataCallback(). That function uses metadata and m, but if I understand the code correctly, both of those are now the same object.