Fixed an issue causing null reference exceptions when loading multiple images