Don't assume a 'local' MapLayer has been added to GeoNode from GeoServer

Obtain name from thumbnail from Maplayer.name instead
Make flake8 happy, remove unused import
Merge pull request #1664 from mwengren/maplayer_thumbnail_fix_pr

Don't assume a 'local' MapLayer has been added to GeoNode from GeoServer