Updated image function construct

If image not exists and set the width and height, then create a new image.