Much more efficient use of CPU/HD, but the code is still not usable long term. A "load image" function that loads all the required images into an array is needed.