implement basic-alignment rules and apply them on img