function for automatic assignment of picture with skin or map