optimize height of pic