diff --git a/twitter_pull.class.inc b/twitter_pull.class.inc
index 8aa1619..0b068b7 100644
--- a/twitter_pull.class.inc
+++ b/twitter_pull.class.inc
@@ -110,6 +110,8 @@ class twitter_puller {
           $obj->username = check_plain($obj->username);
         $obj->userphoto = (isset($item->user) && !empty($item->user->profile_image_url)) ? $item->user->profile_image_url : $item->profile_image_url;
           $obj->userphoto = check_plain($obj->userphoto);
+        $obj->userphoto_https = (isset($item->user) && !empty($item->user->profile_image_url_https)) ? $item->user->profile_image_url_https : $item->profile_image_url_https;
+        $obj->userphoto_https = check_plain($obj->userphoto_https);
         $obj->text = filter_xss($item->text);
         //-- Convert date to unix timestamp so themer can easily work with it.
         $obj->timestamp = strtotime($item->created_at);
diff --git a/twitter_pull.module b/twitter_pull.module
index 664c91e..a3ebbac 100644
--- a/twitter_pull.module
+++ b/twitter_pull.module
@@ -99,6 +99,8 @@ function twitter_pull_render($twitkey, $title = NULL, $num_items = NULL, $themek
  *     Number of tweets to retrieve from Twitter. Can't be more than 200.
  */
 function twitter_pull_retrieve($twitkey, $num_items = NULL) {
+  global $is_https;
+
   // If $num_items is not set, use the default value.
   // This value is checked more rigorously in twitter_puller->check_arguments().
   $num_items = (intval($num_items) > 0) ? intval($num_items) : twitter_pull_num_items();
@@ -129,6 +131,14 @@ function twitter_pull_retrieve($twitkey, $num_items = NULL) {
     }
   }

+  // If we have tweets and are viewing a secure site, we want to set the url
+  // to the userphoto to use the secure image to avoid insecure errors.
+  if (!empty($tweets) && is_array($tweets) && $is_https) {
+    foreach ($tweets as $i => $tweet) {
+      $tweets[$i]->userphoto = $tweet->userphoto_https;
+    }
+  }
+
   return $tweets;
 }
