Change Foreign Key relationship for ResourceBase and Thumbnail

Prevents duplicate thumbnails in db when updatelayers is run

Cascade deletes Thumbnails with ResourceBase removal
Merge pull request #1672 from mwengren/thumbnail_fix

Change Foreign Key relationship for ResourceBase and Thumbnail