// get latest image from table
Uri image = ContentUris.withAppendedId( Media.EXTERNAL_CONTENT_URI, latestId );
Cursor cursor = application.managedQuery( image, columns, null, null, null );
// check if cursus has rows, if not break and exit loop
if( cursor.moveToFirst() ) {
// get thumbnail field
String imageThumb = cursor.getString( cursor.getColumnIndex( Media.MINI_THUMB_MAGIC ) );
// if thumbnail field is not null it means image is written to sdcard
// create new image item and break loop otherwise restart loop to check again