facebook share refactoring and image resizing