[FIX] Filter the extension so it is limited to image files

git-svn-id: file:///var/local/code.tiki.org/tikisvn/trunk@47288 b456876b-0849-0410-b77d-98878d47e9d5
[FIX] Lookup does not need to be in the loop

git-svn-id: file:///var/local/code.tiki.org/tikisvn/trunk@47289 b456876b-0849-0410-b77d-98878d47e9d5