fix bugs with mainImage, add small new functional