modified return value of mkimg()