Factor out tooltip concern from img-previews code