ENH use weights to allow for ordering of images in gallery