Added images function.

Generalized a bit, removing redundancies.
Added images example.