Different css to buddypress cover images by role

Hello,

I use the following code that is for applying different css rules to users’ avatar images by role. How could the code been modified so it would work for users’ cover images too?

add_filter( 'bp_core_avatar_class', 'wpmudev_bp_role_in_class', 10, 4 );

function wpmudev_bp_role_in_class( $class, $item, $object, $params ){

$user = new WP_User( $item );

if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role ){

$class = $role . ' ' . $class;

}
}

return $class;
}