Can you fix the indentation in this block?
The StringList::toString() will return the strings space-separated, which will almost certainly give you invalid image data.  Can you at least just take the first item if you don't want to look for specific ones?