Fix image pattern iteration