Added exclusion check for image extension