Use paths internally, not URIs
Save the thumbnail to PNG

And at the right scale.