Add valid nodes declaration.
Fix setting width when image is aligned center.
Remove unnecessary redeclaration of var.