Set window width based on image width