Added debugging. Moved the mkdir code before the img upload so it can create the path.
Added a longer cookie duration for displaying/hiding the .meta files.