image class extension, other cleanup things