Preliminary image loading function