move base_dir creation up
write out images based on the post name, rather than the raw file name
Merge branch 'image-linking' of github.com:shadowhand/cabin-porn into shadowhand-image-linking
Fixed dead var
Merge branch 'shadowhand-image-linking'