fixed bug with loading image data