Visualizing Dialogues: Enhancing Image Selection through Dialogue Understanding with Large Language Models