Format smileys.php
Improve image resize logic