Fix image indexing.