Fix little jump by calling the resizeMedia method before changing the width attribute