add images
protect input undefined. fixes #1