A flexible framework for Web interfaces to image databases: supporting user-defined ontologies and links to external databases