updating imageScaler directive. making it more modular and testable