Revert "simplified get img function"

This reverts commit 757988d9628f8411e6a41853fdd645dc498e3ca3.

Conflicts:
	js/main.js