Subsite theme mystery man replacement with Buddypress on main site [closed]

The following code needs to placed in the functions.php file of any theme that has a replacement mystery man avatar. Adding it to bp-custom.php will not work in this instance.

<?php   
// Use a differnt image than default mystery man
function bp_custom_set_avatar_constants() {
    define( 'BP_AVATAR_DEFAULT', get_stylesheet_directory_uri() . '/images/mystery-man.jpg' );
    define( 'BP_AVATAR_DEFAULT_THUMB', get_stylesheet_directory_uri() . '/images/mystery-man-50.jpg' );
}
add_action( 'bp_init', 'bp_custom_set_avatar_constants', 2 );
?>

You then need to create an images folder in your theme containing two jpg images of your replacement images, matching the names you define in the code above. The one for BP_AVATAR_DEFAULT_THUMB should be 50px x 50px. The other should be 150px x 150px.