Refactor variable name $f as it throws "Illegal string offset 'name'"

This resolves the misplacement of attached inline images in html emails