mistake with indexing image arrays