fixed part that was throwing errors for some images