fix javascript method to hide error images