Corrected bug with image  loading