Fix the check to see if image exists