update img.php

took away functions and made it shorter