Update main source.

Add image scaling.