Why images are not being displayed correctly?