wp_custom_post_thumbnail - Also display non images attachments -Suggested solution

Hi Richie KS.
I use WPMU Nelo and in the My_WPMUDEV_Featured_Multi_Category_Widget which calls the wp_custom_post_thumbnail () function I also get non images attachements as thumbnail.
I solved the problem by replaying in the functions.php page at line 181 the:
$get_post_attachment = $wpdb->get_var("SELECT guid FROM " . $wpdb->prefix . "posts WHERE post_parent = '" . $detect_post_id . "' AND post_type = 'attachment' ORDER BY menu_order ASC LIMIT 1");

with the following:
$get_post_attachment = $wpdb->get_var("SELECT guid FROM " . $wpdb->prefix . "posts WHERE post_parent = '" . $detect_post_id . "' AND post_type = 'attachment' and post_mime_type='image' ORDER BY menu_order ASC LIMIT 1");

Bests,
Lena