js :JS_NewStringCopyZ() can return NULL, deal with it
When extracting filename from title, make sure it's valid UTF-8
Avoid crashing if decode of an image fails