adding new javascript image handling.