implemented stateful UI
fixed img height bug