This doesn't feel like the right place to put this check. The current implementation also causes a JS error for everything without a mimeType (links, etc.).

```
TypeError: contentProfile.mime is undefined
if (contentProfile.mime.substring(0, 6) !== 'image/' || refreshPreview) {
```