index loop update and image compressed