Fixed bug with image loading