It’s a very common scenario to create a site definition with pages, features, lists, web parts…etc
I have tried to change the web part icon as per the information in MSDN page, by using the “ImageUrl” property, but this didn’t work.
ImageUrl=”/_layouts/????????.png” BaseViewID="0" WebPartZoneID="Left" Name="$Resources:Strings,List_Instance_Title_Discussions_Forum;" WebPartOrder="1" ShowHeaderUI="True"/>
So I decided to catch the webpart and set the ImageUrl programmatically. So the only way to do this is to implement this in the FeatureActivated event in the FeatureReceiver class.