saved code to load the correct image