Image resize and slight correction with 'cast' button click.
added some comments