Catch 404 response and rebuild thumbnail

A bit hacky, but it works for now.