removed loadImage function