Catch exception where local layer doesn't exist in map thumb generation

Partial fix for #1613.