Improved performance by putting image loading into a thread.