mimeType could be null here.
Something like the following code should work:
<code>
if (TextUtils.isEmpty(mimeType)) {
      dataColumn = cursor.getColumnIndex(Images.Media.DATA);
     String thumbData = cur.getString(dataColumn);
     File imageFile = new File(thumbData);
     mimeType = getMediaFileMimeType(imageFile, true);
}
</code>