Cleaned up img handler code.