Fix error reading image