Fix loop error and images