Buddypress set default avatar

I want every existing users who have not yet set their avatar and background image and new registered users have a default avatar and a default background image.

How to do that?

I create a bp-custom.php under plugins/buddypress, with the following code

define ( 'BP_AVATAR_DEFAULT', $img_url );
define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );

But it doesn't work. At least existing users still do not have the default avatar showed.