add javascript to handle image view