Thumbnail Tests and Dependency

Fixing some join table issues - when an image or project is destroyed
the thumbnail is destroyed also. Basic tests.
Thumbnail test fix