Fix image loading bug