Javascript solution for responsive images