Moved image appending entirely to javascrip