image height refactored in js