add function for generating picture