While you could completely hide the icon, it's considerably easier to simply disable it when a selected image is not the right type. To do this, you'll have to use a getEnabled command in the XML for the Inline Image button. That getEnabled command will link to a macro that uses the WindowSelectionChange event.
The way this works is that the event listener checks the selection every time it changes. When it runs this check, it gets whether the selected item is a picture. Then, if it is, it looks for the picture type. If the picture type is correct, then getEnabled status for the icon is changed, disabling it for wrong picture types and enabling it for the ones you want.
There's a learning curve for this. Searching on Word ribbon getenabled and Word WindowSelectionChange event will get you pages that explain the process in detail.