add relative img processing function