Fix for #1237

Only set crossorigin on the element if something is specified