Image scaling fixes