Getting the user picture URL when Gravatar is installed I'm trying to print a user's picture without the link to the user's profile which is what theme('user_picture', array('account' =&gt;$user_item)) will render. If I use image_style_url('thumbnail', $user-&gt;picture-&gt;uri) the Gravatar hook will not be called.

So far the only way I have found to do this is:

if (function_exists('_gravatar_get_account_user_picture')) {
    $picture = _gravatar_get_account_user_picture($user);
} else {
    $picture = $user-&gt;picture-&gt;uri;
}
if (file_valid_uri($picture)) {
    $picture = image_style_url('thumbnail', $picture);
}


But this isn't very elegant, especially since I am developing a module and I'd rather not have to explicitly call the Gravatar module.

Any suggestions?

Thanks!
Obviously, handling directly in the Gravatar module would be best, but another option (though slightly hackish) would be to simply

$img = strip_tags(theme("user_picture", array('account' =&gt; $user_item)), "&lt;img&gt;");