Improved support for multiple picture formats. Stillnot working.