Getting the user picture URL when Gravatar is installed
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;");