I really hate the "Islam is a religion of peace" meme, because it completely ignores what's going on.
It's not simply that Islam is a singular thing and there are a few terrorists going around bombing places. The truth of the situation is far more polarizing (as a Muslim too). We have two major schools of thought, one leaning towards more literal readings (Sunni) and one leaning toward more esoteric readings [as applicable] (Shia).
Now on their own, they are generally ok. There is a little bit on animosity between the two (some Sunni's consider Shia unbelievers, which is a hint towards what I'm leading to). Shia have historically been more peaceful for several reasons but overall it is likely because of it's highly diverse beliefs over it's many, many sects. Sunni on the other hand have a far stricter belief system (and seem to live by ticking boxes).
Around 300 years ago, a kind of counter-Islam that considered both regular Sunni and Shia to be idolaters, arose out of Sunnism. The key figure being Ibn Abd al-Wahhab. This school of radical hyperconservativism has, is and does continue to destroy Islam from the inside and out. Again, they see everyone else as heretics and are trying to replace the major Muslim world with themselves - and seeing how in certain countries the laymen tend to be even more uneducated, it is seen as default Islam in some parts by such people. It's known as Wahhabism (or Salafism) and it's dangerous, the cause of 911, the methodology behind ISIS, Al-Qaeda and Saudi Arabia.
Of course, there are still issues within regular legal traditions in Sunni Islam - it's no secret, and in general I'm personally adverse to Sunnism (for theological reasons foremost) but when we see a terrorist, we've got to be asking "what school of thought specifically inspired this person?" rather than the meaningless question of whether Islam is peaceful or not.