Fix thumbnail generation when not using a custom thumbnail

When use does not provide a custom thumbail we must provide an alternative thumnail if : 

- file size is more than 10M
- File is not an image 
- File is not a PDF