Hide user pictures from guests and web crawlers
None of the core themes have all the preprocess functions or template file in use. The best way to find what's available to use is with the devel_themer module.

Here's what devel_themer gave me:



This says we can use template_preprocess_user_image() or user-picture.tpl.php. When doing logic such as this, it's standard to use preprocess functions. When you're changing HTML structure you use template files.

So you can add the following function to your theme and it should hide all user pictures for anonymous users (web scrapers are considered anonymous users).

function YOURTHEME_preprocess_user_picture(&amp;$variables) {
  // this is the currently logged in user
  $user = $variables['user'];

  // this is the user the picture belongs to
  $account = $variables['account'];

  // If the current user is anonymous don't show the user picture
  if ($user-&gt;uid == 0) {
    $variables['user_picture'] = NULL;
  }
}