edited img loop