fixing resetting of image