Added support for decimated images - fixed bug