Image layer js refactoring.
Image layer js refactoring.