Added image scaling functions