How to include images in a javascript component

In a javascript component we can have .js and .css files. But how we can include also some images (.jpg,.png).

@JavaScript({"slider-connector.js", "jquery-ui.js"})
public class SliderServerComponent extends AbstractJavaScriptComponent {

I found a way but i do not know if it is the proper method.
1.I extended on theme (e.g. hover).
2.I created under the hover folder just created ( C:\myjscomponent\modules\web\themes\hover ) the following sub folders ( images\components\mycomponent )
3.I put all the images in this folder (C:\myjscomponent\modules\web\themes\hover\images\components\mycomponent)

I reference the image path like this:

img src=‘VAADIN/themes/hover/images/components/mycomponent/icon2.png’