fix the bug in not loading as per checked that the positions of image is NaN and added the screen width and height