Bug imgIdx now converted to int