Full replication of TimberImage::resize