resize the element when setting the first image source (image element)