Fix thumbnail generation when not using a custom thumbnail

When user **does not provide a custom thumbnail** we must provide an alternative thumbnail if : 

- File size is more than 10M
- File is not an image 
- File is not a PDF