Change Foreign Key relationship for ResourceBase and Thumbnail

Prevents duplicate thumbnails in db when updatelayers is run

Cascade deletes Thumbnails with ResourceBase removal
Merge branch 'thumbnail_fix' into ogc_service_getcaps_links_test