Remove unused codes
Collect usable images
Add missing check
Create DOM and append to first place