def get_image_path(uploaded_image, sample_image_name): """Determine the image path to use""" if uploaded_image: return uploaded_image elif sample_image_name: return sample_images.get(sample_image_name) else: raise ValueError("No image selected. Please upload an image or select a sample")