Added image scaling

The scaling preserves aspect ratio of the input image and centers it
appropriately.