TypeError: Cannot read property 'mainImage' of null