Autodetect image size.
JPG support.
Minor changes.
Minor changes.