Fixed minor bug with image index.