fix reset bug when no image is loaded