Minor fixes in attachment model
Add image thumbnail generator