diff --git a/flexslider_fields/flexslider_fields.module b/flexslider_fields/flexslider_fields.module
index fddc835..d74c083 100644
--- a/flexslider_fields/flexslider_fields.module
+++ b/flexslider_fields/flexslider_fields.module
@@ -159,6 +159,12 @@ function flexslider_fields_field_formatter_view($entity_type, $entity, $field, $
         $item['caption'] = filter_xss($item['item']['title']);
       }
 
+      // Add the thumbnail url according to the optionset confirguration.
+      $optionset = flexslider_optionset_load($display['settings']['optionset']);
+      if ($optionset->imagestyle_thumbnail) {
+        $item['thumbnail_url'] = image_style_url($optionset->imagestyle_thumbnail, $item['item']['uri']);
+      }
+
       $items[$key] = $item;
     }
 
diff --git a/theme/flexslider.theme.inc b/theme/flexslider.theme.inc
index c3b27d4..641a806 100755
--- a/theme/flexslider.theme.inc
+++ b/theme/flexslider.theme.inc
@@ -30,6 +30,7 @@ function theme_flexslider_list(&$vars) {
 
       $output .= theme('flexslider_list_item', array(
         'item' => $item['slide'],
+        'thumbnail_url' => isset($item['thumbnail_url']) ? $item['thumbnail_url'] : FALSE,
         'settings' => array(
           'optionset' => $optionset,
         ),
@@ -134,13 +135,10 @@ function template_process_flexslider_list_item(&$vars) {
 
   // Generated thumbnail support
   if (isset($settings['optionset']->options['controlNav']) and $settings['optionset']->options['controlNav'] === "thumbnails") {
-    // If the thumbnails are enabled in the option set, scan for the first img
-    // tag and extract the src attribute to set as the thumbnail data
-    $src = array();
-    preg_match("<img.+?src=[\"'](.+?)[\"'].+?>", $item, $src);
-
-    if (!empty($src[1])) {
-      $attributes['data-thumb'] = $src[1];
+    // If the thumbnails are enabled in the option set, check to see if a
+    // thumbnail url has been provided and set that as the thumbnail data.
+    if ($vars['thumbnail_url']) {
+      $attributes['data-thumb'] = $vars['thumbnail_url'];
     }
   }
 
