anchor.diff:      false;
   file_exists(Name, Context) ->
       RelName = case hd(Name) of
  -        $/ -> tl(Name);
  -        _ -> Name
  -    end,
  +                  $/ -> tl(Name);
  +                  _ -> Name
  +              end,
       case mochiweb_util:safe_relative_path(RelName) of
           undefined -> false;
           SafePath ->
               RelName = case hd(SafePath) of
  -                "/" -> tl(SafePath);
  -                _ -> SafePath
  -            end,
  +                          "/" -> tl(SafePath);
  +                          _ -> SafePath
  +                      end,
               Root = case z_context:get(root, Context) of
  -                undefined -> 
  -                    case z_context:get(is_media_preview, Context, false) of
  -                        true  -> [z_path:media_preview(Context)];
  -                        false -> [z_path:media_archive(Context)]
  -                    end;
  -                ConfRoot -> ConfRoot
  -            end,
  +                       undefined -> 
  +                           case z_context:get(is_media_preview, Context, false) of
  +                               true  -> [z_path:media_preview(Context)];
  +                               false -> [z_path:media_archive(Context)]
  +                           end;
  +                       ConfRoot -> ConfRoot
  +                   end,
               file_exists1(Root, RelName, Context)
       end.
   
  
positive.code:             {false, ReqData, Context};
          Safepath  ->
              MediaPath = case z_context:get(media_path, Context) of
                  undefined -> z_path:media_archive(Context);
                  ConfMediaPath -> ConfMediaPath
              end,
              
              MediaFile = case Safepath of 
                      "lib/" ++ LibPath ->  
                          case z_module_indexer:find(lib, LibPath, Context) of 
                              {ok, ModuleFilename} -> ModuleFilename; 
                              {error, _} -> filename:join(MediaPath, Safepath) 
                          end; 
                      _ -> 
                          filename:join(MediaPath, Safepath) 
              end,
              case filelib:is_regular(MediaFile) of
                  true ->
                      % Media file exists, perform the resize
                      Root = case z_context:get(root, Context) of
                          [ConfRoot|_] -> ConfRoot;
                          _ -> z_path:media_preview(Context)
                      end,
                      PreviewFile = filename:join(Root, Path),
                      case z_media_preview:convert(MediaFile, PreviewFile, PreviewPropList, Context) of
                          ok -> {true, ReqData, z_context:set(fullpath, PreviewFile, Context)};
  
negative.code: 
  %% Encode the data so that the identity variant comes first and then the gzip'ed variant
  encode_data(Data) when is_binary(Data) ->
      {Data, zlib:gzip(Data)}.
  
  decode_data(gzip, Data) when is_binary(Data) ->
      zlib:gzip(Data);
  decode_data(identity, Data) when is_binary(Data) ->
      Data;
  decode_data(identity, {Data, _Gzip}) ->
      Data;
  decode_data(gzip, {_Data, Gzip}) ->
      Gzip.
  
      