adding preview state for images