add primitive plotting function for img files