Allow getImages() to load images contained in projects/datasets

Add an optional third argument `type` to getImages(). If type is project or
dataset, getImages(session, ids, type) calls getProjects/getDatasets(session,
ids) and reconstructs the list of images in the graph.