You don't need to call `$("#img-path")` again here. You can chain `attr()` to the line above to avoid re-selecting `#img-path`.