removed img creation from for loop