Wrote core code for smartImage plugin