Added error checking for arguments and image loading.
Checked code style.
Wrote some error and info messages.