Generate correct embed URLs
Avoid loss of tempfile by moving serialisation step into block

I hope anyway.