Modified the image part. Added Error Handling for image