added resize_or_blank function