Add check if mimetype is null before apply thumbnail frame

To avoid segfaults on file deletions