Added image scaling functionality