Fix for image loading code.