Code cleanup
Handle jpg, and normalize filename testing