Return and use isPreviewAvailable for share previews

Since the mime type is known, now isPreviewAvailable is returned as well
and used by the JS side to properly render mime icon and previews.