Make index figure captions dynamic