Replaced find with find_last_of when detecting the location of the . in a string pointing to the image used in the widget.