Unable to send gif image to the Messanger

I want to send gif image stored in the drawable to the messenger. I tried below code it displaying file not attached method .Please, anyone, help me to resolve this issue.

          int[] imageId = {
         R.drawable.congrats,
         R.drawable.dog,
        R.drawable.giphy,
        R.drawable.good_night,
        R.drawable.pokeman,
        R.drawable.redrose,
        R.drawable.wibd
};

  Uri path = Uri.parse("android.resource://" + 
   ImageKeyboard.this.getPackageName() + "/" + imageId[position]);


 String defaultSmsPackageName = Telephony.Sms.getDefaultSmsPackage(ImageKeyboard.this); //Need to change the build to API 19
                   Intent intent = new Intent(Intent.ACTION_SEND,Uri.parse("mms://"));

                intent.setPackage(defaultSmsPackageName);
                   intent.putExtra("sms_body", "Hi how are you");
                   intent.putExtra(Intent.EXTRA_STREAM, path);
                   intent.setType("image/gif");
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
               startActivity(intent);