Update libraries/img.php

typo fix, code cleanup