Modified the logic to generate urls with extension

/content/multi-image/jcrcontent/par/smartimagemultifield.img.png/image-3.png