code: def is_valid_image_extension(file_path):
      
      valid_extensions = ['.jpeg', '.jpg', '.gif', '.png']
      _, extension = os.path.splitext(file_path)
      return extension.lower() in valid_extensions
docs: is_valid_image_extension.