First call resizeMedia before changing width attr